diff --git a/HashingTool/App.xaml b/HashingTool/App.xaml index 5f3d51229ea9cca8b8b80f0dfd7f4b23ede717c4..53da578cb0d8bff061a41981915c85e3b1be7e61 100644 --- a/HashingTool/App.xaml +++ b/HashingTool/App.xaml @@ -9,7 +9,9 @@ <ResourceDictionary Source="Resources/Icon_XML_NOK.xaml" /> <ResourceDictionary Source="Resources/Icon_OK.xaml" /> <ResourceDictionary Source="Resources/Icon_NOK.xaml" /> + <ResourceDictionary Source="Resources/UserInterfaceResources.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> + </Application.Resources> </Application> \ No newline at end of file diff --git a/HashingTool/HashingTool.csproj b/HashingTool/HashingTool.csproj index c75f9fa4679feef3e1a86e917d6c69ed3731f842..02f6adcf81b46ad658db11460f30f2a4a0bbef55 100644 --- a/HashingTool/HashingTool.csproj +++ b/HashingTool/HashingTool.csproj @@ -136,6 +136,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Resources\UserInterfaceResources.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Views\HashComponentData.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> diff --git a/HashingTool/Resources/UserInterfaceResources.xaml b/HashingTool/Resources/UserInterfaceResources.xaml new file mode 100644 index 0000000000000000000000000000000000000000..c76de56b7b85ab1084675f661b91d917b32b9941 --- /dev/null +++ b/HashingTool/Resources/UserInterfaceResources.xaml @@ -0,0 +1,302 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + + + <SolidColorBrush x:Key="Expander.MouseOver.Circle.Stroke" Color="#FF3C7FB1" /> + <SolidColorBrush x:Key="Expander.MouseOver.Circle.Fill" Color="Transparent" /> + <SolidColorBrush x:Key="Expander.MouseOver.Arrow.Stroke" Color="#222" /> + <SolidColorBrush x:Key="Expander.Pressed.Circle.Stroke" Color="#FF526C7B" /> + <SolidColorBrush x:Key="Expander.Pressed.Circle.Fill" Color="Transparent" /> + <SolidColorBrush x:Key="Expander.Pressed.Arrow.Stroke" Color="#FF003366" /> + <SolidColorBrush x:Key="Expander.Disabled.Circle.Stroke" Color="DarkGray" /> + <SolidColorBrush x:Key="Expander.Disabled.Circle.Fill" Color="Transparent" /> + <SolidColorBrush x:Key="Expander.Disabled.Arrow.Stroke" Color="#666" /> + <SolidColorBrush x:Key="Expander.Static.Circle.Fill" Color="Transparent" /> + <SolidColorBrush x:Key="Expander.Static.Circle.Stroke" Color="DarkGray" /> + <SolidColorBrush x:Key="Expander.Static.Arrow.Stroke" Color="#666" /> + <Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ToggleButton}"> + <Border Padding="{TemplateBinding Padding}"> + <Grid Background="Transparent" SnapsToDevicePixels="False"> + <Grid.RowDefinitions> + <RowDefinition Height="19" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + <Grid> + <Grid.LayoutTransform> + <TransformGroup> + <TransformGroup.Children> + <TransformCollection> + <RotateTransform Angle="-90" /> + </TransformCollection> + </TransformGroup.Children> + </TransformGroup> + </Grid.LayoutTransform> + <Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" + Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19" /> + <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" + Stroke="{StaticResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" VerticalAlignment="Center" /> + </Grid> + <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" Grid.Row="1" RecognizesAccessKey="True" + SnapsToDevicePixels="True" VerticalAlignment="Top" /> + </Grid> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsChecked" Value="true"> + <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> + </Trigger> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}" /> + </Trigger> + <Trigger Property="IsPressed" Value="true"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}" /> + <Setter Property="StrokeThickness" TargetName="circle" Value="1.5" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}" /> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ToggleButton}"> + <Border Padding="{TemplateBinding Padding}"> + <Grid Background="Transparent" SnapsToDevicePixels="False"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="19" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <Grid> + <Grid.LayoutTransform> + <TransformGroup> + <TransformGroup.Children> + <TransformCollection> + <RotateTransform Angle="180" /> + </TransformCollection> + </TransformGroup.Children> + </TransformGroup> + </Grid.LayoutTransform> + <Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" + Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19" /> + <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" + Stroke="{StaticResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" VerticalAlignment="Center" /> + </Grid> + <ContentPresenter Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" + SnapsToDevicePixels="True" VerticalAlignment="Center" /> + </Grid> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsChecked" Value="true"> + <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> + </Trigger> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}" /> + </Trigger> + <Trigger Property="IsPressed" Value="true"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}" /> + <Setter Property="StrokeThickness" TargetName="circle" Value="1.5" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}" /> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ToggleButton}"> + <Border Padding="{TemplateBinding Padding}"> + <Grid Background="Transparent" SnapsToDevicePixels="False"> + <Grid.RowDefinitions> + <RowDefinition Height="19" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + <Grid> + <Grid.LayoutTransform> + <TransformGroup> + <TransformGroup.Children> + <TransformCollection> + <RotateTransform Angle="90" /> + </TransformCollection> + </TransformGroup.Children> + </TransformGroup> + </Grid.LayoutTransform> + <Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" + Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19" /> + <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" + Stroke="{StaticResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" VerticalAlignment="Center" /> + </Grid> + <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" Grid.Row="1" RecognizesAccessKey="True" + SnapsToDevicePixels="True" VerticalAlignment="Top" /> + </Grid> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsChecked" Value="true"> + <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> + </Trigger> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}" /> + </Trigger> + <Trigger Property="IsPressed" Value="true"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}" /> + <Setter Property="StrokeThickness" TargetName="circle" Value="1.5" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}" /> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="ExpanderHeaderFocusVisual"> + <Setter Property="Control.Template"> + <Setter.Value> + <ControlTemplate> + <Border> + <Rectangle Margin="0" SnapsToDevicePixels="true" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2" /> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ToggleButton}"> + <Border Padding="{TemplateBinding Padding}"> + <Grid Background="Transparent" SnapsToDevicePixels="False"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="19" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" + Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19" /> + <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" + Stroke="{StaticResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" VerticalAlignment="Center" /> + <ContentPresenter Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="4,0,0,0" + RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center" /> + </Grid> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsChecked" Value="true"> + <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> + </Trigger> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}" /> + </Trigger> + <Trigger Property="IsPressed" Value="true"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}" /> + <Setter Property="StrokeThickness" TargetName="circle" Value="1.5" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}" /> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}" /> + <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}" /> + <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="HeaderStretchExpanderStyle" TargetType="{x:Type Expander}"> + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" /> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + <Setter Property="VerticalContentAlignment" Value="Stretch" /> + <Setter Property="BorderBrush" Value="Transparent" /> + <Setter Property="BorderThickness" Value="1" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Expander}"> + <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" + Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="true"> + <DockPanel> + <ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" + ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" Content="{TemplateBinding Header}" + DockPanel.Dock="Top" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" + FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FontStyle="{TemplateBinding FontStyle}" + FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" + FontFamily="{TemplateBinding FontFamily}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" + MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" + Style="{StaticResource ExpanderDownHeaderStyle}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> + <ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" + Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> + </DockPanel> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsExpanded" Value="true"> + <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" /> + </Trigger> + <Trigger Property="ExpandDirection" Value="Right"> + <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right" /> + <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left" /> + <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}" /> + </Trigger> + <Trigger Property="ExpandDirection" Value="Up"> + <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top" /> + <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom" /> + <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}" /> + </Trigger> + <Trigger Property="ExpandDirection" Value="Left"> + <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left" /> + <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right" /> + <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}" /> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="DigestValueLabelStyle"> + <Setter Property="Label.FontSize" Value="16" /> + </Style> + + <Style x:Key="DigestValueTextboxStyle"> + <Setter Property="TextBox.FontFamily" Value="Courier New" /> + <Setter Property="TextBox.FontWeight" Value="Bold" /> + <Setter Property="Label.FontSize" Value="16" /> + </Style> + + <SolidColorBrush x:Key="Color.SuccessGreen" Color="#FF00A500" /> + <SolidColorBrush x:Key="Color.ErrorRed" Color="#FFFF0000" /> +</ResourceDictionary> \ No newline at end of file diff --git a/HashingTool/ViewModel/ApplicationViewModel.cs b/HashingTool/ViewModel/ApplicationViewModel.cs index 517ac31dae16ccccff38000d4c7118cf7ffbf7f1..946a51cfee530166b18672266408d82a2fc56dde 100644 --- a/HashingTool/ViewModel/ApplicationViewModel.cs +++ b/HashingTool/ViewModel/ApplicationViewModel.cs @@ -18,12 +18,12 @@ namespace HashingTool.ViewModel public ApplicationViewModel() { - var homeView = new HomeViewModel(this); + var homeView = new HomeViewModel(); AvailableViews = new List<IMainView> { - new HashComponentDataViewModel(this), - new VerifyComponentInputDataViewModel(this), - new VerifyJobInputDataViewModel(this), - new VerifyResultDataViewModel(this), + new HashComponentDataViewModel(), + new VerifyComponentInputDataViewModel(), + new VerifyJobInputDataViewModel(), + new VerifyResultDataViewModel(), }; CurrentViewModel = homeView; diff --git a/HashingTool/ViewModel/HashComponentDataViewModel.cs b/HashingTool/ViewModel/HashComponentDataViewModel.cs index 7f5af7cb3bac76b2a56e3a2f430f7d5272dce2ff..0f18bcda4e204c3166e1a34693ad71cfeba6d6cd 100644 --- a/HashingTool/ViewModel/HashComponentDataViewModel.cs +++ b/HashingTool/ViewModel/HashComponentDataViewModel.cs @@ -46,11 +46,7 @@ namespace HashingTool.ViewModel }; } - public HashComponentDataViewModel(ApplicationViewModel applicationViewModel) : this() - { - _applicationViewModel = applicationViewModel; - } - + public string Name { get { return "Hash Component Data"; } diff --git a/HashingTool/ViewModel/HashedXMLFile.cs b/HashingTool/ViewModel/HashedXMLFile.cs new file mode 100644 index 0000000000000000000000000000000000000000..2241b46d90bc9eb9d9997295004dc679829fd803 --- /dev/null +++ b/HashingTool/ViewModel/HashedXMLFile.cs @@ -0,0 +1,200 @@ +using System; +using System.ComponentModel; +using System.Xml; +using HashingTool.Helper; +using HashingTool.ViewModel.UserControl; + +namespace HashingTool.ViewModel +{ + public class VectoXMLFile : ObservableObject + { + protected readonly XMLFile _xmlFile; + + protected string _manufacturerDigestComputed; + protected bool? _valid; + protected string _name; + protected string _tooltip; + protected readonly Func<XmlDocument, bool?> _contentCheck; + protected string _componentType; + protected readonly Action<XmlDocument, VectoXMLFile> _validateHashes; + + + public VectoXMLFile(IOService ioService, string name, Func<XmlDocument, bool?> contentCheck, + Action<XmlDocument, VectoXMLFile> hashValidation = null) + { + IoService = ioService; + _validateHashes = hashValidation; + _xmlFile = new XMLFile(IoService, true); + _xmlFile.PropertyChanged += FileChanged; + Name = name; + _contentCheck = contentCheck; + // TODO + CanonicalizationMethods = new[] { + "urn:vecto:xml:2017:canonicalization", + "http://www.w3.org/2001/10/xml-exc-c14n#" + }; + Valid = null; + ValidTooltip = VerifyResultDataViewModel.ToolTip_None; + } + + protected virtual void FileChanged(object sender, PropertyChangedEventArgs e) + { + if (_xmlFile.IsValid != null && XMLFile.IsValid.HasValue && _xmlFile.IsValid.Value) { + Valid = _contentCheck(_xmlFile.Document); + if (Valid != null && Valid.Value) { + ValidTooltip = VerifyResultDataViewModel.ToolTip_OK; + } else { + ValidTooltip = VerifyResultDataViewModel.ToolTip_InvalidFileType; + } + } else { + Valid = false; + ValidTooltip = VerifyResultDataViewModel.ToolTip_XMLValidationFailed; + } + + if (Valid != null && Valid.Value && _validateHashes != null) { + _validateHashes(_xmlFile.Document, this); + //try { + // _validateHashes(_xmlFile.Document, this); + // Valid = result.Valid; + // ValidTooltip = result.Valid ? VerifyResultDataViewModel.ToolTip_OK : VerifyResultDataViewModel.ToolTip_HashInvalid; + // DigestValueComputed = result.DigestComputed; + // DigestValueRead = result.DigestRead; + //} catch (Exception ex) { + // Valid = false; + // DigestValueComputed = ""; + // DigestValueRead = ""; + //} + } + } + + + public XMLFile XMLFile + { + get { return _xmlFile; } + } + + public string Name + { + get { return _name; } + private set { + if (_name == value) { + return; + } + _name = value; + RaisePropertyChanged("Name"); + } + } + + public string[] CanonicalizationMethods { get; private set; } + + + public string DigestValueComputed + { + get { return _manufacturerDigestComputed; } + internal set { + if (_manufacturerDigestComputed == value) { + return; + } + _manufacturerDigestComputed = value; + RaisePropertyChanged("DigestValueComputed"); + } + } + + + public bool? Valid + { + get { return _valid; } + internal set { + if (_valid == value) { + return; + } + _valid = value; + RaisePropertyChanged("Valid"); + } + } + + public string ValidTooltip + { + get { return _tooltip; } + set { + if (_tooltip == value) { + return; + } + _tooltip = value; + RaisePropertyChanged("ValidTooltip"); + } + } + + public string Component + { + get { return _componentType; } + set { + if (_componentType == value) { + return; + } + _componentType = value; + RaisePropertyChanged("Component"); + } + } + } + + public class HashedXMLFile : VectoXMLFile + { + protected string _manufacturerDigestRead; + + public HashedXMLFile(IOService ioService, string name, Func<XmlDocument, bool?> contentCheck, + Action<XmlDocument, VectoXMLFile> hashValidation = null) : base(ioService, name, contentCheck, hashValidation) {} + + public string DigestValueRead + { + get { return _manufacturerDigestRead; } + internal set { + if (_manufacturerDigestRead == value) { + return; + } + _manufacturerDigestRead = value; + RaisePropertyChanged("DigestValueRead"); + } + } + } + + public class ReportXMLFile : HashedXMLFile + { + private string _jobDigestRead; + + public ReportXMLFile(IOService ioService, string name, Func<XmlDocument, bool?> contentCheck, + Action<XmlDocument, VectoXMLFile> hashValidation = null) + : base(ioService, name, contentCheck, hashValidation) + { + _xmlFile.PropertyChanged += ReadJobDigest; + } + + private void ReadJobDigest(object sender, PropertyChangedEventArgs e) + { + var jobDigest = ""; + if (e.PropertyName != "Document") { + return; + } + if (_xmlFile.Document != null && _xmlFile.Document.DocumentElement != null) { + var node = + _xmlFile.Document.SelectSingleNode("//*[local-name()='InputDataSignature']//*[local-name()='DigestValue']"); + if (node != null) { + jobDigest = node.InnerText; + } + } + JobDigest = jobDigest; + } + + public string JobDigest + { + get { return _jobDigestRead; } + internal set { + if (_jobDigestRead == value) { + return; + } + _jobDigestRead = value; + RaisePropertyChanged("JobDigest"); + } + } + } +} diff --git a/HashingTool/ViewModel/HomeViewModel.cs b/HashingTool/ViewModel/HomeViewModel.cs index cf2b139d8b1fe807f64caa0e0463b46a922c9612..95d52ab95b83b1ee7cd079e1b0cb62ba0fabf5bc 100644 --- a/HashingTool/ViewModel/HomeViewModel.cs +++ b/HashingTool/ViewModel/HomeViewModel.cs @@ -5,16 +5,8 @@ namespace HashingTool.ViewModel { public class HomeViewModel : ObservableObject, IMainView { - private readonly ApplicationViewModel _applicationViewModel; - - public HomeViewModel() {} - - public HomeViewModel(ApplicationViewModel applicationViewModel) - { - _applicationViewModel = applicationViewModel; - } - - + + public string Name { get { return "Home"; } @@ -25,10 +17,7 @@ namespace HashingTool.ViewModel get { return ApplicationViewModel.AvailableViews; } } - public ICommand ChangeViewCommand - { - get { return _applicationViewModel == null ? null : _applicationViewModel.ChangeViewCommand; } - } + public ICommand ShowHomeViewCommand { diff --git a/HashingTool/ViewModel/UserControl/XMLFile.cs b/HashingTool/ViewModel/UserControl/XMLFile.cs index 92166dfb7b791a9d326ee6d96ae92ebba2a3e942..7e36aa6830a2e46631691bcc720e8804b17a3a35 100644 --- a/HashingTool/ViewModel/UserControl/XMLFile.cs +++ b/HashingTool/ViewModel/UserControl/XMLFile.cs @@ -88,9 +88,9 @@ namespace HashingTool.ViewModel.UserControl public ICommand SetXMLFileCommnd { - get { return new RelayCommand<string>(SetXMLFile, (f)=> !_busy);} + get { return new RelayCommand<string>(SetXMLFile, (f) => !_busy); } } - + private async void SetXMLFile(string fileName) { if (!File.Exists(fileName)) { @@ -100,9 +100,9 @@ namespace HashingTool.ViewModel.UserControl IsValid = null; return; } - var stream = File.OpenRead(fileName); - - await LoadXMLFile(stream); + using (var stream = File.OpenRead(fileName)) { + await LoadXMLFile(stream); + } } @@ -110,13 +110,14 @@ namespace HashingTool.ViewModel.UserControl { string filename; - var stream = IoService.OpenFileDialog(null, ".xml", "VECTO XML file|*.xml", out filename); - if (stream == null) { - return; - } + using (var stream = IoService.OpenFileDialog(null, ".xml", "VECTO XML file|*.xml", out filename)) { + if (stream == null) { + return; + } - await LoadXMLFile(stream); - Source = filename; + await LoadXMLFile(stream); + Source = filename; + } } private async Task LoadXMLFile(Stream stream) @@ -125,7 +126,7 @@ namespace HashingTool.ViewModel.UserControl IsValid = null; ContentValid = null; XMLValidationErrors.Clear(); - + if (_validate) { var ms = new MemoryStream(); @@ -160,7 +161,6 @@ namespace HashingTool.ViewModel.UserControl { var valid = true; try { - var validator = new XMLValidator(r => { valid = r; }, (s, e) => { Application.Current.Dispatcher.Invoke(() => XMLValidationErrors.Add( diff --git a/HashingTool/ViewModel/VerifyComponentInputDataViewModel.cs b/HashingTool/ViewModel/VerifyComponentInputDataViewModel.cs index 6718fe3163a514579aff213eb2283e45445f1864..b51ae126ff6b0aefb9a48d528689894a3964ed5c 100644 --- a/HashingTool/ViewModel/VerifyComponentInputDataViewModel.cs +++ b/HashingTool/ViewModel/VerifyComponentInputDataViewModel.cs @@ -12,7 +12,6 @@ namespace HashingTool.ViewModel { public class VerifyComponentInputDataViewModel : ObservableObject, IMainView { - private readonly ApplicationViewModel _applicationViewModel; private string _digestValueComputed; private string _digestValueRead; private bool _componentDataValid; @@ -32,11 +31,6 @@ namespace HashingTool.ViewModel }; } - public VerifyComponentInputDataViewModel(ApplicationViewModel applicationViewModel) : this() - { - _applicationViewModel = applicationViewModel; - } - public string Name { get { return "Verify Input Data"; } @@ -115,9 +109,9 @@ namespace HashingTool.ViewModel ComponentDataValid = false; DigestValueComputed = ""; DigestValueRead = ""; - Component = ""; + Component = ""; return; - } + } try { var h = VectoHash.Load(_componentFile.Document); @@ -135,6 +129,7 @@ namespace HashingTool.ViewModel DigestValueComputed = ""; DigestValueRead = ""; Component = ""; + _componentFile.XMLValidationErrors.Add(e.Message); } } } diff --git a/HashingTool/ViewModel/VerifyJobInputDataViewModel.cs b/HashingTool/ViewModel/VerifyJobInputDataViewModel.cs index 5676bb98d30c6a1cc23ef473dfb9ba21f0725200..a53f9fcc44589224076a4484ab40f2385c9ebd2f 100644 --- a/HashingTool/ViewModel/VerifyJobInputDataViewModel.cs +++ b/HashingTool/ViewModel/VerifyJobInputDataViewModel.cs @@ -1,9 +1,7 @@ using System; using System.Collections.ObjectModel; using System.ComponentModel; -using System.IO; using System.Linq; -using System.Windows; using System.Windows.Input; using HashingTool.ViewModel.UserControl; using TUGraz.VectoHashing; @@ -12,7 +10,6 @@ namespace HashingTool.ViewModel { public class VerifyJobInputDataViewModel : ObservableObject, IMainView { - private readonly ApplicationViewModel _applicationViewModel; private string _digestValueComputed; private bool _componentDataValid; private readonly XMLFile _jobFile; @@ -31,12 +28,7 @@ namespace HashingTool.ViewModel Components = new ObservableCollection<ComponentEntry>(); } - public VerifyJobInputDataViewModel(ApplicationViewModel applicationViewModel) - : this() - { - _applicationViewModel = applicationViewModel; - } - + public string Name { get { return "Verify Job"; } @@ -89,8 +81,9 @@ namespace HashingTool.ViewModel private void DoValidateHash() { - if (_jobFile.ContentValid == null || !_jobFile.ContentValid.Value) + if (_jobFile.ContentValid == null || !_jobFile.ContentValid.Value) { return; + } try { Components.Clear(); var h = VectoHash.Load(_jobFile.Document); @@ -123,6 +116,7 @@ namespace HashingTool.ViewModel } catch (Exception e) { DigestValueComputed = ""; JobDataValid = false; + _jobFile.XMLValidationErrors.Add(e.Message); } } } diff --git a/HashingTool/ViewModel/VerifyResultDataViewModel.cs b/HashingTool/ViewModel/VerifyResultDataViewModel.cs index 83a8519f8b7a29fba8c197348e0cc667d8e8e227..978abcde85466c086b4e41c1927629b25123b627 100644 --- a/HashingTool/ViewModel/VerifyResultDataViewModel.cs +++ b/HashingTool/ViewModel/VerifyResultDataViewModel.cs @@ -48,11 +48,6 @@ namespace HashingTool.ViewModel } - public VerifyResultDataViewModel(ApplicationViewModel applicationViewModel) : this() - { - _applicationViewModel = applicationViewModel; - } - public ObservableCollection<string> CanonicalizationMethods { get; private set; } public string Name diff --git a/HashingTool/Views/Dialog/XMLValidationErrorsDialog.xaml b/HashingTool/Views/Dialog/XMLValidationErrorsDialog.xaml index 754f044ac23da1d2a52eca41011409ce94c43c2f..d972aef493c523339ace7ac2de41a56c24f2f554 100644 --- a/HashingTool/Views/Dialog/XMLValidationErrorsDialog.xaml +++ b/HashingTool/Views/Dialog/XMLValidationErrorsDialog.xaml @@ -2,16 +2,17 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="XML Errors/Warnings" Height="358" Width="623" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:views="clr-namespace:HashingTool.Views" - d:DataContext="{d:DesignInstance views:XMLValidationErrorsDialog}" - > + d:DataContext="{d:DesignInstance views:XMLValidationErrorsDialog}"> <Grid> <ListBox x:Name="lbErrors" Margin="10,10,10,62" ItemsSource="{Binding XMLErrors}" /> - <Button IsCancel="True" x:Name="btnClose" Content="Close" Margin="0,0,10,10" Height="22" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="75" /> - <Label x:Name="lblCount" HorizontalAlignment="Left" Margin="10,0,0,31" Width="340" Height="26" VerticalAlignment="Bottom"> + <Button IsCancel="True" x:Name="btnClose" Content="Close" Margin="0,0,10,10" Height="22" VerticalAlignment="Bottom" + HorizontalAlignment="Right" Width="75" /> + <Label x:Name="lblCount" HorizontalAlignment="Left" Margin="10,0,0,31" Width="340" Height="26" + VerticalAlignment="Bottom"> <Label.Content> <TextBlock Text="{Binding XMLErrors.Count, StringFormat='{}{0} Warnings/Errors'}" /> </Label.Content> diff --git a/HashingTool/Views/HashComponentData.xaml b/HashingTool/Views/HashComponentData.xaml index c95e50199cb47b79dff96a6ee50091d90df4e6b6..b74ceb993b5c8dda1bbf55a98a3a740e7d7fe2a0 100644 --- a/HashingTool/Views/HashComponentData.xaml +++ b/HashingTool/Views/HashComponentData.xaml @@ -7,7 +7,7 @@ xmlns:local="clr-namespace:HashingTool.Views" x:Class="HashingTool.Views.HashComponentData" mc:Ignorable="d" - d:DesignHeight="603.125" d:DesignWidth="666"> + d:DesignHeight="368.125" d:DesignWidth="666"> <UserControl.Resources> <Helper:CollectionConverter x:Key="CollectionConverter" /> </UserControl.Resources> @@ -15,24 +15,37 @@ <UserControl.DataContext> <ViewModel:HashComponentDataViewModel /> </UserControl.DataContext> - <Grid> - <Label Name="lblHeader" HorizontalAlignment="Center" Margin="10,10,0,0" VerticalAlignment="Top" + <DockPanel> + <Label DockPanel.Dock="Top" Name="lblHeader" HorizontalAlignment="Center" Margin="10,10,0,0" VerticalAlignment="Top" Content="{Binding Name}" FontWeight="Bold" FontSize="18" /> - <Button Name="btnBack" Content="Back" Command="{Binding ShowHomeViewCommand}" Margin="0,0,10,10" - HorizontalAlignment="Right" - Width="75" Height="22" VerticalAlignment="Bottom" /> - <Button Content="Save Component Data" HorizontalAlignment="Right" Margin="0,0,90,10" Width="143" Height="22" - VerticalAlignment="Bottom" Command="{Binding SaveHashedDocument, Mode=OneWay}" /> - <local:VectoXMLFileSelector Margin="10,93,10,0" VerticalAlignment="Top" XMLFile="{Binding ComponentFile}" /> + <Label DockPanel.Dock="Top" x:Name="lblFileSelect" Content="Component data:" HorizontalAlignment="Left" Margin="10,0" + VerticalAlignment="Top" /> + + <local:VectoXMLFileSelector DockPanel.Dock="Top" Margin="10,0" VerticalAlignment="Top" + XMLFile="{Binding ComponentFile}" /> + + <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right"> + <Button Content="Save Component Data" HorizontalAlignment="Right" Margin="0,0,15,10" Width="143" Height="22" + VerticalAlignment="Bottom" Command="{Binding SaveHashedDocument, Mode=OneWay}" /> + <Button Name="btnBack" Content="Back" Command="{Binding ShowHomeViewCommand}" Margin="0,0,10,10" + HorizontalAlignment="Right" + Width="75" Height="22" VerticalAlignment="Bottom" /> + </StackPanel> - <Grid Margin="15,141,5,37"> + <Grid DockPanel.Dock="Top" Margin="10,0,1,0"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <StackPanel Orientation="Horizontal" Grid.Row="0"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,0,5"> <Label> <Label.Content> <TextBlock Text="{Binding XMLValidationErrors.Count, StringFormat='{}{0} Warnings/Errors'}" /> @@ -61,58 +74,54 @@ </Button.Style> </Button> </StackPanel> - <Grid Grid.Row="1" Margin="0,10,0,0"> - <Label x:Name="lblDigestValue" Content="Digest Value:" HorizontalAlignment="Left" Margin="10,38,0,0" - VerticalAlignment="Top" RenderTransformOrigin="0.57,0.5" FontSize="16" /> - <TextBox x:Name="tbDigestValue" Text="{Binding DigestValue}" Margin="117,41,100,0" - VerticalAlignment="Top" RenderTransformOrigin="4.1,-2.1" FontFamily="Courier New" FontWeight="Bold" - FontSize="16" Foreground="#FF03932B" /> - <Label Name="lblC14N" Content="Canonicalization:" HorizontalAlignment="Left" Margin="10,10,0,0" - VerticalAlignment="Top" /> - <Label Name="lblC14NList" - Content="{Binding CanonicalizaitionMethods, Converter={StaticResource CollectionConverter}}" - Margin="117,10,100,0" VerticalAlignment="Top" /> - <Button Content="Copy" Margin="0,41,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="75" - Click="Button_Click_1"> - <Button.Style> - <Style TargetType="Button"> - <Setter Property="IsEnabled" Value="false" /> - <Style.Triggers> - <DataTrigger Binding="{Binding ComponentDataValid}" Value="True"> - <Setter Property="IsEnabled" Value="True" /> - </DataTrigger> - </Style.Triggers> - </Style> - </Button.Style> - </Button> - </Grid> - <Grid Grid.Row="2" Margin="0,10,0,0"> - <ContentControl HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Top" Width="66" Height="64"> - <ContentControl.RenderTransform> - <ScaleTransform ScaleX="1.5" ScaleY="1.5" /> - </ContentControl.RenderTransform> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="Content" Value="" /> - <Setter Property="ToolTip" Value="X" /> - <Style.Triggers> - <DataTrigger Binding="{Binding ComponentDataValid}" Value="True"> - <Setter Property="ContentTemplate" Value="{StaticResource Icon_OK}" /> - <Setter Property="ToolTip" Value="Component data validates against schema" /> - </DataTrigger> - <DataTrigger Binding="{Binding ComponentDataValid}" Value="False"> - <Setter Property="ContentTemplate" Value="{StaticResource Icon_NOK}" /> - <Setter Property="ToolTip" Value="Component data does NOT validat against schema" /> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> - </Grid> + <Label Grid.Row="1" Grid.Column="0" Name="lblC14N" Content="Canonicalization:" HorizontalAlignment="Left" + Margin="0" /> + <TextBox Grid.Row="1" Grid.Column="1" Name="lblC14NList" + Text="{Binding CanonicalizaitionMethods, Converter={StaticResource CollectionConverter}}" + Margin="10,2" /> + <Button Grid.Row="1" Grid.Column="2" Content="Copy" Margin="10,2,0,2" HorizontalAlignment="Right" Width="75" + Click="Button_Click_1"> + <Button.Style> + <Style TargetType="Button"> + <Setter Property="IsEnabled" Value="false" /> + <Style.Triggers> + <DataTrigger Binding="{Binding ComponentDataValid}" Value="True"> + <Setter Property="IsEnabled" Value="True" /> + </DataTrigger> + </Style.Triggers> + </Style> + </Button.Style> + </Button> + <Label Grid.Row="2" Grid.Column="0" x:Name="lblDigestValue" Content="Digest Value:" HorizontalAlignment="Left" + Margin="0" Style="{StaticResource DigestValueLabelStyle}" /> + <TextBox Grid.Row="2" Grid.Column="1" x:Name="tbDigestValue" Text="{Binding DigestValue}" Margin="10,2" + VerticalAlignment="Top" RenderTransformOrigin="4.1,-2.1" Style="{StaticResource DigestValueTextboxStyle}" + Foreground="{StaticResource Color.SuccessGreen}" /> + <ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Center" Margin="0,0,0,0" + VerticalAlignment="Top" Width="66" Height="64"> + <ContentControl.LayoutTransform> + <ScaleTransform ScaleX="1.5" ScaleY="1.5" /> + </ContentControl.LayoutTransform> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content" Value="" /> + <Setter Property="ToolTip" Value="X" /> + <Style.Triggers> + <DataTrigger Binding="{Binding ComponentDataValid}" Value="True"> + <Setter Property="ContentTemplate" Value="{StaticResource Icon_OK}" /> + <Setter Property="ToolTip" Value="Component data validates against schema" /> + </DataTrigger> + <DataTrigger Binding="{Binding ComponentDataValid}" Value="False"> + <Setter Property="ContentTemplate" Value="{StaticResource Icon_NOK}" /> + <Setter Property="ToolTip" Value="Component data does NOT validat against schema" /> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </Grid> - <Label x:Name="lblFileSelect" Content="Component data:" HorizontalAlignment="Left" Margin="10,75,0,0" - VerticalAlignment="Top" /> - </Grid> + </DockPanel> </UserControl> \ No newline at end of file diff --git a/HashingTool/Views/HomeView.xaml b/HashingTool/Views/HomeView.xaml index 9b95c8bd72f4611a5c2dbebfd7fa9ee4727e43ac..5cee0b6c9380c24557f6fc165841dae65a05c4de 100644 --- a/HashingTool/Views/HomeView.xaml +++ b/HashingTool/Views/HomeView.xaml @@ -10,7 +10,7 @@ <Grid x:Name="MainGrid"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" MinWidth="30" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.DataContext> diff --git a/HashingTool/Views/UserControl/VectoXMLFileSelector.xaml b/HashingTool/Views/UserControl/VectoXMLFileSelector.xaml index 3605aa3fc1778f8b3552527230b1ff4d99b00d2e..037e2c0ee83e19119851480848d6e23b0a0e835e 100644 --- a/HashingTool/Views/UserControl/VectoXMLFileSelector.xaml +++ b/HashingTool/Views/UserControl/VectoXMLFileSelector.xaml @@ -83,7 +83,7 @@ </Style> </StackPanel.Style> <Label Content="{Binding XMLFile.XMLValidationErrors.Count}" - ContentStringFormat="XML Validation: {0} Warnings/Errors" + ContentStringFormat="{}{0} Warnings/Errors" MinWidth="80"> <Label.Style> <Style TargetType="Label"> diff --git a/HashingTool/Views/VerifyComponentInputData.xaml b/HashingTool/Views/VerifyComponentInputData.xaml index cbee72fe342d2283afb45ec73f29be2359391204..8f9f1d2f4893813b0e41871099fbff22c9e532df 100644 --- a/HashingTool/Views/VerifyComponentInputData.xaml +++ b/HashingTool/Views/VerifyComponentInputData.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:ViewModel="clr-namespace:HashingTool.ViewModel" + xmlns:viewModel="clr-namespace:HashingTool.ViewModel" xmlns:views="clr-namespace:HashingTool.Views" xmlns:helper="clr-namespace:HashingTool.Helper" x:Class="HashingTool.Views.VerifyComponentInputData" @@ -11,69 +11,101 @@ d:DesignHeight="422" d:DesignWidth="534"> <UserControl.Resources> <helper:CollectionConverter x:Key="CollectionConverter" /> + </UserControl.Resources> <UserControl.DataContext> - <ViewModel:VerifyComponentInputDataViewModel/> + <viewModel:VerifyComponentInputDataViewModel /> </UserControl.DataContext> - <Grid> - <Label x:Name="lblFileSelect" Content="Component data:" HorizontalAlignment="Left" Margin="10,75,0,0" - VerticalAlignment="Top" /> - <Label Name="lblHeader" HorizontalAlignment="Center" Margin="10,10,0,0" VerticalAlignment="Top" + <DockPanel> + + <Label DockPanel.Dock="Top" Name="lblHeader" HorizontalAlignment="Center" Margin="10,10,0,0" VerticalAlignment="Top" Content="{Binding Name}" FontWeight="Bold" FontSize="18" /> - <Button Name="btnBack" Content="Back" Command="{Binding ShowHomeViewCommand}" Margin="0,0,10,10" + <Button DockPanel.Dock="Bottom" Name="btnBack" Content="Back" Command="{Binding ShowHomeViewCommand}" + Margin="0,0,10,10" HorizontalAlignment="Right" Width="75" Height="22" VerticalAlignment="Bottom" /> - <views:VectoXMLFileSelector Margin="0,93,0,0" VerticalAlignment="Top" XMLFile="{Binding ComponentFile}" Height="80"/> - <Grid Margin="0,178,0,0"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> - </Grid.RowDefinitions> - <Grid Grid.Row="0" Margin="0,5"> - <Label Content="Component:"/> - <TextBox Text="{Binding Component}" Margin="155,0,10,0" IsReadOnly="True"/> - </Grid> - <Grid Grid.Row="1" Margin="0,5"> - <Label Content="Canonicalization methods:"/> - <TextBox Text="{Binding CanonicalizaitionMethods , Converter={StaticResource CollectionConverter}}" Margin="155,0,10,0" IsReadOnly="True"/> - </Grid> - <Grid Grid.Row="2" Margin="0,5"> - <Label Content="Digest Value read:"/> - <TextBox Text="{Binding DigestValueRead}" Margin="155,0,10,0" IsReadOnly="True"/> - </Grid> - <Grid Grid.Row="3" Margin="0,5"> - <Label Content="Digest Value computed:"/> - <TextBox Text="{Binding DigestValueComputed}" Margin="155,0,10,0" IsReadOnly="True"/> - </Grid> - <Grid Grid.Row="4" Margin="0,10,0,0"> - <ContentControl HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Top" Width="66" Height="64"> - <ContentControl.RenderTransform> + <DockPanel> + <Label DockPanel.Dock="Top" x:Name="lblFileSelect" Content="Component data:" HorizontalAlignment="Left" + Margin="10,2,0,2" + VerticalAlignment="Top" /> + <views:VectoXMLFileSelector DockPanel.Dock="Top" Margin="10,0,0,0" VerticalAlignment="Top" + XMLFile="{Binding ComponentFile}" Height="80" /> + <Grid Margin="0,0,0,0" DockPanel.Dock="Bottom"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"></ColumnDefinition> + <ColumnDefinition Width="*"></ColumnDefinition> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + + <Label Grid.Row="0" Grid.Column="0" Content="Component:" /> + <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Component}" Margin="10,2" IsReadOnly="True" /> + + <Label Grid.Row="1" Grid.Column="0" Content="Canonicalization methods:" /> + <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding CanonicalizaitionMethods , Converter={StaticResource CollectionConverter}}" + Margin="10,2" IsReadOnly="True" /> + + <Label Grid.Row="2" Grid.Column="0" Content="Digest Value read:" Style="{StaticResource DigestValueLabelStyle}" Template="{DynamicResource LabelControlTemplate1}"/> + <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding DigestValueRead}" Margin="10,2" IsReadOnly="True"> + <TextBox.Style> + <Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}"> + <Style.Triggers> + <DataTrigger Binding="{Binding ComponentDataValid}" Value="True"> + <Setter Property="Foreground" Value="{StaticResource Color.SuccessGreen}"/> + </DataTrigger> + <DataTrigger Binding="{Binding ComponentDataValid}" Value="False"> + <Setter Property="Foreground" Value="{StaticResource Color.ErrorRed}"/> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBox.Style> + </TextBox> + + <Label Grid.Row="3" Grid.Column="0" Content="Digest Value computed:" Style="{StaticResource DigestValueLabelStyle}"/> + <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding DigestValueComputed}" Margin="10,2" IsReadOnly="True" > + <TextBox.Style> + <Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}"> + <Style.Triggers> + <DataTrigger Binding="{Binding ComponentDataValid}" Value="True"> + <Setter Property="Foreground" Value="{StaticResource Color.SuccessGreen}"/> + </DataTrigger> + <DataTrigger Binding="{Binding ComponentDataValid}" Value="False"> + <Setter Property="Foreground" Value="{StaticResource Color.ErrorRed}"/> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBox.Style> + </TextBox> + + <ContentControl Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="0,40,0,0" VerticalAlignment="Top" Width="66" Height="64"> + <ContentControl.LayoutTransform> <ScaleTransform ScaleX="1.5" ScaleY="1.5" /> - </ContentControl.RenderTransform> + </ContentControl.LayoutTransform> <ContentControl.Style> <Style TargetType="ContentControl"> <Setter Property="Content" Value="" /> - <Setter Property="ToolTip" Value=""/> + <Setter Property="ToolTip" Value="" /> <Style.Triggers> <DataTrigger Binding="{Binding ComponentDataValid}" Value="True"> <Setter Property="ContentTemplate" Value="{StaticResource Icon_OK}" /> - <Setter Property="ToolTip" Value="Component data validates against schema"/> + <Setter Property="ToolTip" Value="Component data validates against schema" /> </DataTrigger> <DataTrigger Binding="{Binding ComponentDataValid}" Value="False"> <Setter Property="ContentTemplate" Value="{StaticResource Icon_NOK}" /> - <Setter Property="ToolTip" Value="Component data does NOT validat against schema"/> + <Setter Property="ToolTip" Value="Component data does NOT validat against schema" /> </DataTrigger> </Style.Triggers> </Style> </ContentControl.Style> </ContentControl> - </Grid> - </Grid> - </Grid> + </DockPanel> + </DockPanel> </UserControl> \ No newline at end of file diff --git a/HashingTool/Views/VerifyJobInputData.xaml b/HashingTool/Views/VerifyJobInputData.xaml index 9e86b8f9d5f5e2ab91a5af74082580d67c27e05f..a3afacbf4079346140988d8b04dcd3713db932c5 100644 --- a/HashingTool/Views/VerifyJobInputData.xaml +++ b/HashingTool/Views/VerifyJobInputData.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:ViewModel="clr-namespace:HashingTool.ViewModel" + xmlns:viewModel="clr-namespace:HashingTool.ViewModel" xmlns:views="clr-namespace:HashingTool.Views" xmlns:helper="clr-namespace:HashingTool.Helper" x:Class="HashingTool.Views.VerifyJobInputData" @@ -11,126 +11,160 @@ d:DesignHeight="555" d:DesignWidth="534"> <UserControl.Resources> <helper:CollectionConverter x:Key="CollectionConverter" /> - <BooleanToVisibilityConverter x:Key="Bool2Vis" /> </UserControl.Resources> <UserControl.DataContext> - <ViewModel:VerifyJobInputDataViewModel /> + <viewModel:VerifyJobInputDataViewModel /> </UserControl.DataContext> - <Grid> - <Label x:Name="lblFileSelect" Content="Job data:" HorizontalAlignment="Left" Margin="10,75,0,0" - VerticalAlignment="Top" /> - <Label Name="lblHeader" HorizontalAlignment="Center" Margin="10,10,0,0" VerticalAlignment="Top" + <DockPanel> + + <Label DockPanel.Dock="Top" Name="lblHeader" HorizontalAlignment="Center" Margin="0,10" VerticalAlignment="Top" Content="{Binding Name}" FontWeight="Bold" FontSize="18" /> - <Button Name="btnBack" Content="Back" Command="{Binding ShowHomeViewCommand}" Margin="0,0,10,10" + <Button DockPanel.Dock="Bottom" Name="btnBack" Content="Back" Command="{Binding ShowHomeViewCommand}" + Margin="0,0,10,10" HorizontalAlignment="Right" Width="75" Height="22" VerticalAlignment="Bottom" /> - <views:VectoXMLFileSelector Margin="0,93,0,0" VerticalAlignment="Top" XMLFile="{Binding JobFile}" Height="80" /> - <Grid Margin="0,178,0,0"> + <Label x:Name="lblFileSelect" DockPanel.Dock="Top" Content="Job data:" HorizontalAlignment="Left" Margin="10,0,0,0" + VerticalAlignment="Top" /> + <views:VectoXMLFileSelector Margin="0,0,0,0" DockPanel.Dock="Top" VerticalAlignment="Top" XMLFile="{Binding JobFile}" + Height="80" /> + <Grid DockPanel.Dock="Top" Margin="0,0,0,0"> <Grid.RowDefinitions> - <RowDefinition Height="*" MaxHeight="300" /> + <RowDefinition Height="*"/> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <Grid Grid.Row="1" Margin="0,5"> - <Label Content="Canonicalization methods:" /> - <TextBox Text="{Binding CanonicalizationMethods , Converter={StaticResource CollectionConverter}}" - Margin="155,0,10,0" IsReadOnly="True" /> - </Grid> - <Grid Grid.Row="2" Margin="0,5"> - <Label Content="Digest Value computed:" /> - <TextBox Text="{Binding DigestValueComputed}" Margin="155,0,10,0" - IsReadOnly="True" /> - </Grid> - <Grid Grid.Row="3" Margin="0,10,0,0"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="29*" /> - <ColumnDefinition Width="60*" /> - </Grid.ColumnDefinitions> - <ContentControl HorizontalAlignment="Center" Margin="60,0,234,0" VerticalAlignment="Top" Width="66" Height="64" - Grid.Column="1"> - <ContentControl.RenderTransform> - <ScaleTransform ScaleX="1.5" ScaleY="1.5" /> - </ContentControl.RenderTransform> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="Content" Value="" /> - <Setter Property="ToolTip" Value="" /> - <Style.Triggers> - <DataTrigger Binding="{Binding JobDataValid}" Value="True"> - <Setter Property="ContentTemplate" Value="{StaticResource Icon_OK}" /> - <Setter Property="ToolTip" Value="Component data validates against schema" /> - </DataTrigger> - <DataTrigger Binding="{Binding JobDataValid}" Value="False"> - <Setter Property="ContentTemplate" Value="{StaticResource Icon_NOK}" /> - <Setter Property="ToolTip" Value="Component data does NOT validat against schema" /> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + + <Label Grid.Row="1" Grid.Column="0" Content="Canonicalization methods:" /> + <TextBox Grid.Row="1" Grid.Column="1" + Text="{Binding CanonicalizationMethods , Converter={StaticResource CollectionConverter}}" + Margin="10,2" IsReadOnly="True" /> - </Grid> - <ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto" Background="{x:Static SystemColors.ControlLightBrush}" - Margin="10,0"> - <ItemsControl Margin="0,0,0,20" x:Name="ComponentListing" ItemsSource="{Binding Components}"> + <Label Grid.Row="2" Grid.Column="0" Content="Digest Value computed:" Style="{StaticResource DigestValueLabelStyle}" /> + <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding DigestValueComputed}" Margin="10,2" + IsReadOnly="True" Style="{StaticResource DigestValueTextboxStyle}" /> + <ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="0,10,0,0" + VerticalAlignment="Top" Width="50" Height="50"> + <ContentControl.LayoutTransform> + <ScaleTransform ScaleX="1.5" ScaleY="1.5" /> + </ContentControl.LayoutTransform> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content" Value="" /> + <Setter Property="ToolTip" Value="" /> + <Style.Triggers> + <DataTrigger Binding="{Binding JobDataValid}" Value="True"> + <Setter Property="ContentTemplate" Value="{StaticResource Icon_OK}" /> + <Setter Property="ToolTip" Value="Component data validates against schema" /> + </DataTrigger> + <DataTrigger Binding="{Binding JobDataValid}" Value="False"> + <Setter Property="ContentTemplate" Value="{StaticResource Icon_NOK}" /> + <Setter Property="ToolTip" Value="Component data does NOT validat against schema" /> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + + + <ScrollViewer Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" VerticalScrollBarVisibility="Auto" + Background="{x:Static SystemColors.ControlLightBrush}" + Margin="10,0,10,10"> + <ItemsControl Margin="3" x:Name="ComponentListing" ItemsSource="{Binding Components}"> + <ItemsControl.ItemContainerStyle> + <Style> + <Setter Property="FrameworkElement.Margin" Value="0,2" /> + </Style> + </ItemsControl.ItemContainerStyle> <ItemsControl.ItemTemplate> <DataTemplate> - <Expander Margin="4" Header="{Binding}"> - <Expander.HeaderTemplate> - <DataTemplate> - <Grid - HorizontalAlignment="{Binding Path=HorizontalAlignment, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentPresenter}}, Mode=OneWayToSource}"> - <Grid.ColumnDefinitions> - <ColumnDefinition MinWidth="150" /> - <ColumnDefinition Width="100" /> - </Grid.ColumnDefinitions> - <TextBlock Grid.Column="0" Text="{Binding Component}" Margin="4,0" /> - <StackPanel Grid.Column="1" VerticalAlignment="Top" Width="16" Height="16" HorizontalAlignment="Left"> - <ContentControl ContentTemplate="{StaticResource Icon_OK}" - Visibility="{Binding Valid, Converter={StaticResource Bool2Vis}}"> - <ContentControl.RenderTransform> + <Border BorderBrush="White" BorderThickness="1" CornerRadius="2"> + <Expander Margin="4" Header="{Binding}" Style="{DynamicResource HeaderStretchExpanderStyle}"> + <Expander.HeaderTemplate> + <DataTemplate> + <DockPanel HorizontalAlignment="Stretch"> + <ContentControl DockPanel.Dock="Right" Width="35" Height="35" Margin="0,0,10,0"> + <ContentControl.LayoutTransform> <ScaleTransform ScaleX=".4" ScaleY=".4" /> - </ContentControl.RenderTransform> + </ContentControl.LayoutTransform> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content" Value="" /> + <Style.Triggers> + <DataTrigger Binding="{Binding Valid}" Value="True"> + <Setter Property="ContentTemplate" Value="{StaticResource Icon_OK}" /> + </DataTrigger> + <DataTrigger Binding="{Binding Valid}" Value="False"> + <Setter Property="ContentTemplate" Value="{StaticResource Icon_NOK}" /> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> </ContentControl> - <ContentControl ContentTemplate="{StaticResource Icon_NOK}" - Visibility="{Binding Path=InValid, Converter={StaticResource Bool2Vis}}"> - <ContentControl.RenderTransform> - <ScaleTransform ScaleX=".4" ScaleY=".4" /> - </ContentControl.RenderTransform> - </ContentControl> - </StackPanel> - </Grid> - </DataTemplate> - </Expander.HeaderTemplate> - <Expander.Content> - <Border BorderBrush="{x:Static SystemColors.ControlDarkDarkBrush}" BorderThickness="0,0,0,1" Margin="0,0,0,3"> - <Grid> + <TextBlock DockPanel.Dock="Left" Text="{Binding Component}" Margin="4,0" FontSize="16" FontWeight="Bold" /> + </DockPanel> + </DataTemplate> + </Expander.HeaderTemplate> + <Expander.Content> + <Grid Margin="0,5,0,0"> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> - <Grid Row="0" Margin="10,13,0,3"> - <Label Content="Canonicalization methods:" /> - <TextBox Text="{Binding CanonicalizationMethod , Converter={StaticResource CollectionConverter}}" - Margin="155,0,10,0" IsReadOnly="True" /> - </Grid> - <Grid Row="1" Margin="10,2,0,3"> - <Label Content="Digest Value read:" /> - <TextBox Text="{Binding DigestValueRead}" - Margin="155,0,10,0" IsReadOnly="True" /> - </Grid> - <Grid Row="2" Margin="10,2,0,3"> - <Label Content="Digest Value computed:" /> - <TextBox Text="{Binding DigestValueComputed}" - Margin="155,0,10,0" IsReadOnly="True" /> - </Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + + <Label Grid.Row="0" Grid.Column="0" Content="Canonicalization methods:" /> + <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding CanonicalizationMethod , Converter={StaticResource CollectionConverter}}" + Margin="10,2" IsReadOnly="True" /> + + <Label Grid.Row="1" Grid.Column="0" Content="Digest Value read:" Style="{StaticResource DigestValueLabelStyle}" /> + <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding DigestValueRead}" + Margin="10,2" IsReadOnly="True"> + <TextBox.Style> + <Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}"> + <Style.Triggers> + <DataTrigger Binding="{Binding Valid}" Value="True"> + <Setter Property="Foreground" Value="{StaticResource Color.SuccessGreen}"/> + </DataTrigger> + <DataTrigger Binding="{Binding Valid}" Value="False"> + <Setter Property="Foreground" Value="{StaticResource Color.ErrorRed}"/> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBox.Style> + </TextBox> + + <Label Grid.Row="2" Grid.Column="0" Content="Digest Value computed:" Style="{StaticResource DigestValueLabelStyle}" /> + <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding DigestValueComputed}" + Margin="10,2" IsReadOnly="True" > + <TextBox.Style> + <Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}"> + <Style.Triggers> + <DataTrigger Binding="{Binding Valid}" Value="True"> + <Setter Property="Foreground" Value="{StaticResource Color.SuccessGreen}"/> + </DataTrigger> + <DataTrigger Binding="{Binding Valid}" Value="False"> + <Setter Property="Foreground" Value="{StaticResource Color.ErrorRed}"/> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBox.Style> + </TextBox> + </Grid> - </Border> - </Expander.Content> - </Expander> + + </Expander.Content> + </Expander> + </Border> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> @@ -138,6 +172,5 @@ </Grid> - - </Grid> + </DockPanel> </UserControl> \ No newline at end of file diff --git a/HashingTool/Views/VerifyResults.xaml b/HashingTool/Views/VerifyResults.xaml index c2467937e2bf40904d52e9377680d5af0b59e29c..559d25fcd8ddf09536be32269f7794caa1bb4cf9 100644 --- a/HashingTool/Views/VerifyResults.xaml +++ b/HashingTool/Views/VerifyResults.xaml @@ -3,22 +3,20 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:ViewModel="clr-namespace:HashingTool.ViewModel" + xmlns:viewModel="clr-namespace:HashingTool.ViewModel" xmlns:views="clr-namespace:HashingTool.Views" - xmlns:hashingTool="clr-namespace:HashingTool" xmlns:helper="clr-namespace:HashingTool.Helper" x:Class="HashingTool.Views.VerifyResults" mc:Ignorable="d"> <UserControl.DataContext> - <ViewModel:VerifyResultDataViewModel /> + <viewModel:VerifyResultDataViewModel /> </UserControl.DataContext> <UserControl.Resources> <helper:CollectionConverter x:Key="CollectionConverter" /> - <BooleanToVisibilityConverter x:Key="Bool2Vis" /> - <DataTemplate x:Key="ExpanderHeader"> + <DataTemplate x:Key="ExpanderHeader" DataType="viewModel:VectoXMLFile"> <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="top" MinWidth="450"> - <TextBlock DockPanel.Dock="Top" Text="{Binding Name}" /> + <TextBlock DockPanel.Dock="Top" Text="{Binding Name}" FontWeight="Bold"/> <ContentControl DockPanel.Dock="Right" Width="35" Height="35" Margin="10,-10,10,0" ToolTip="{Binding ValidTooltip}"> @@ -45,8 +43,7 @@ </DockPanel> </DataTemplate> - <DataTemplate x:Key="ExpanderContentJobFile" DataType="ViewModel:VectoXMLFile"> - + <DataTemplate x:Key="ExpanderContentJobFile" DataType="viewModel:VectoXMLFile"> <Grid> <Grid.RowDefinitions> <RowDefinition /> @@ -54,7 +51,11 @@ <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> - <StackPanel Orientation="Horizontal" Grid.Row="0"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"> <Label> <Label.Content> <TextBlock @@ -84,21 +85,19 @@ </Button.Style> </Button> </StackPanel> - <Grid Row="1" Margin="10,13,0,3"> - <Label Content="Canonicalization methods:" /> - <TextBox + + <Label Grid.Row="1" Grid.Column="0" Content="Canonicalization methods:" /> + <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding CanonicalizationMethods, Mode=OneWay , Converter={StaticResource CollectionConverter}}" - Margin="155,0,10,0" IsReadOnly="True" /> - </Grid> - <Grid Row="3" Margin="10,2,0,3"> - <Label Content="Digest Value computed:" /> - <TextBox Text="{Binding DigestValueComputed}" - Margin="155,0,10,0" IsReadOnly="True" /> - </Grid> + Margin="10,2" IsReadOnly="True" /> + + <Label Grid.Row="2" Grid.Column="0" Content="Digest Value computed:" Style="{StaticResource DigestValueLabelStyle}"/> + <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding DigestValueComputed}" + Margin="10,2" IsReadOnly="True" Style="{StaticResource DigestValueTextboxStyle}"/> </Grid> </DataTemplate> - <DataTemplate x:Key="ExpanderContentReport" DataType="ViewModel:ReportXMLFile"> + <DataTemplate x:Key="ExpanderContentReport" DataType="viewModel:ReportXMLFile"> <Grid> <Grid.RowDefinitions> <RowDefinition /> @@ -107,7 +106,11 @@ <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> - <StackPanel Orientation="Horizontal" Grid.Row="0"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"> <Label> <Label.Content> <TextBlock Text="{Binding XMLFile.XMLValidationErrors.Count, StringFormat='{}{0} Warnings/Errors'}" /> @@ -136,312 +139,50 @@ </Button.Style> </Button> </StackPanel> - <Grid Row="1" Margin="10,13,0,3"> - <Label Content="Job Digest Value from file:" /> - <TextBox Text="{Binding JobDigest, Mode=OneWay}" - Margin="155,0,10,0" IsReadOnly="True" /> - </Grid> - <Grid Row="2" Margin="10,2,0,3"> - <Label Content="Canonicalization methods:" /> - <TextBox Text="{Binding CanonicalizationMethods, Mode=OneWay , Converter={StaticResource CollectionConverter}}" - Margin="155,0,10,0" IsReadOnly="True" /> - </Grid> - <Grid Row="3" Margin="10,2,0,3"> - <Label Content="Digest Value read:" /> - <TextBox Text="{Binding DigestValueRead}" Margin="155,0,10,0" IsReadOnly="True" /> - </Grid> - <Grid Row="4" Margin="10,2,0,3"> - <Label Content="Digest Value computed:" /> - <TextBox Text="{Binding DigestValueComputed}" Margin="155,0,10,0" IsReadOnly="True" /> - </Grid> + + <Label Grid.Row="1" Grid.Column="0" Content="Job Digest Value from file:" Style="{StaticResource DigestValueLabelStyle}"/> + <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding JobDigest, Mode=OneWay}" + Margin="10,2" IsReadOnly="True" Style="{StaticResource DigestValueTextboxStyle}"/> + + <Label Grid.Row="2" Grid.Column="0" Content="Canonicalization methods:" /> + <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding CanonicalizationMethods, Mode=OneWay , Converter={StaticResource CollectionConverter}}" + Margin="10,2" IsReadOnly="True" /> + + <Label Grid.Row="3" Grid.Column="0" Content="Digest Value read:" Style="{StaticResource DigestValueLabelStyle}" /> + <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding DigestValueRead}" Margin="10,2" IsReadOnly="True" > + <TextBox.Style> + <Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}"> + <Style.Triggers> + <DataTrigger Binding="{Binding Valid}" Value="True"> + <Setter Property="Foreground" Value="{StaticResource Color.SuccessGreen}"/> + </DataTrigger> + <DataTrigger Binding="{Binding Valid}" Value="False"> + <Setter Property="Foreground" Value="{StaticResource Color.ErrorRed}"/> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBox.Style> + </TextBox> + + <Label Grid.Row="4" Grid.Column="0" Content="Digest Value computed:" Style="{StaticResource DigestValueLabelStyle}" /> + <TextBox Grid.Row="4" Grid.Column="1" Text="{Binding DigestValueComputed}" Margin="10,2" IsReadOnly="True" > + <TextBox.Style> + <Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}"> + <Style.Triggers> + <DataTrigger Binding="{Binding Valid}" Value="True"> + <Setter Property="Foreground" Value="{StaticResource Color.SuccessGreen}"/> + </DataTrigger> + <DataTrigger Binding="{Binding Valid}" Value="False"> + <Setter Property="Foreground" Value="{StaticResource Color.ErrorRed}"/> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBox.Style> + </TextBox> + </Grid> </DataTemplate> - <SolidColorBrush x:Key="Expander.MouseOver.Circle.Stroke" Color="#FF3C7FB1" /> - <SolidColorBrush x:Key="Expander.MouseOver.Circle.Fill" Color="Transparent" /> - <SolidColorBrush x:Key="Expander.MouseOver.Arrow.Stroke" Color="#222" /> - <SolidColorBrush x:Key="Expander.Pressed.Circle.Stroke" Color="#FF526C7B" /> - <SolidColorBrush x:Key="Expander.Pressed.Circle.Fill" Color="Transparent" /> - <SolidColorBrush x:Key="Expander.Pressed.Arrow.Stroke" Color="#FF003366" /> - <SolidColorBrush x:Key="Expander.Disabled.Circle.Stroke" Color="DarkGray" /> - <SolidColorBrush x:Key="Expander.Disabled.Circle.Fill" Color="Transparent" /> - <SolidColorBrush x:Key="Expander.Disabled.Arrow.Stroke" Color="#666" /> - <SolidColorBrush x:Key="Expander.Static.Circle.Fill" Color="Transparent" /> - <SolidColorBrush x:Key="Expander.Static.Circle.Stroke" Color="DarkGray" /> - <SolidColorBrush x:Key="Expander.Static.Arrow.Stroke" Color="#666" /> - <Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="{x:Type ToggleButton}"> - <Border Padding="{TemplateBinding Padding}"> - <Grid Background="Transparent" SnapsToDevicePixels="False"> - <Grid.RowDefinitions> - <RowDefinition Height="19" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - <Grid> - <Grid.LayoutTransform> - <TransformGroup> - <TransformGroup.Children> - <TransformCollection> - <RotateTransform Angle="-90" /> - </TransformCollection> - </TransformGroup.Children> - </TransformGroup> - </Grid.LayoutTransform> - <Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" - Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19" /> - <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" - Stroke="{StaticResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" VerticalAlignment="Center" /> - </Grid> - <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" Grid.Row="1" RecognizesAccessKey="True" - SnapsToDevicePixels="True" VerticalAlignment="Top" /> - </Grid> - </Border> - <ControlTemplate.Triggers> - <Trigger Property="IsChecked" Value="true"> - <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> - </Trigger> - <Trigger Property="IsMouseOver" Value="true"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}" /> - </Trigger> - <Trigger Property="IsPressed" Value="true"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}" /> - <Setter Property="StrokeThickness" TargetName="circle" Value="1.5" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}" /> - </Trigger> - <Trigger Property="IsEnabled" Value="false"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}" /> - </Trigger> - </ControlTemplate.Triggers> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - <Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="{x:Type ToggleButton}"> - <Border Padding="{TemplateBinding Padding}"> - <Grid Background="Transparent" SnapsToDevicePixels="False"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="19" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Grid> - <Grid.LayoutTransform> - <TransformGroup> - <TransformGroup.Children> - <TransformCollection> - <RotateTransform Angle="180" /> - </TransformCollection> - </TransformGroup.Children> - </TransformGroup> - </Grid.LayoutTransform> - <Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" - Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19" /> - <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" - Stroke="{StaticResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" VerticalAlignment="Center" /> - </Grid> - <ContentPresenter Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" - SnapsToDevicePixels="True" VerticalAlignment="Center" /> - </Grid> - </Border> - <ControlTemplate.Triggers> - <Trigger Property="IsChecked" Value="true"> - <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> - </Trigger> - <Trigger Property="IsMouseOver" Value="true"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}" /> - </Trigger> - <Trigger Property="IsPressed" Value="true"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}" /> - <Setter Property="StrokeThickness" TargetName="circle" Value="1.5" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}" /> - </Trigger> - <Trigger Property="IsEnabled" Value="false"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}" /> - </Trigger> - </ControlTemplate.Triggers> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - <Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="{x:Type ToggleButton}"> - <Border Padding="{TemplateBinding Padding}"> - <Grid Background="Transparent" SnapsToDevicePixels="False"> - <Grid.RowDefinitions> - <RowDefinition Height="19" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - <Grid> - <Grid.LayoutTransform> - <TransformGroup> - <TransformGroup.Children> - <TransformCollection> - <RotateTransform Angle="90" /> - </TransformCollection> - </TransformGroup.Children> - </TransformGroup> - </Grid.LayoutTransform> - <Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" - Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19" /> - <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" - Stroke="{StaticResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" VerticalAlignment="Center" /> - </Grid> - <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" Grid.Row="1" RecognizesAccessKey="True" - SnapsToDevicePixels="True" VerticalAlignment="Top" /> - </Grid> - </Border> - <ControlTemplate.Triggers> - <Trigger Property="IsChecked" Value="true"> - <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> - </Trigger> - <Trigger Property="IsMouseOver" Value="true"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}" /> - </Trigger> - <Trigger Property="IsPressed" Value="true"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}" /> - <Setter Property="StrokeThickness" TargetName="circle" Value="1.5" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}" /> - </Trigger> - <Trigger Property="IsEnabled" Value="false"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}" /> - </Trigger> - </ControlTemplate.Triggers> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - <Style x:Key="ExpanderHeaderFocusVisual"> - <Setter Property="Control.Template"> - <Setter.Value> - <ControlTemplate> - <Border> - <Rectangle Margin="0" SnapsToDevicePixels="true" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2" /> - </Border> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - <Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="{x:Type ToggleButton}"> - <Border Padding="{TemplateBinding Padding}"> - <Grid Background="Transparent" SnapsToDevicePixels="False"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="19" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" - Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19" /> - <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" - Stroke="{StaticResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" VerticalAlignment="Center" /> - <ContentPresenter Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="4,0,0,0" - RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center" /> - </Grid> - </Border> - <ControlTemplate.Triggers> - <Trigger Property="IsChecked" Value="true"> - <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> - </Trigger> - <Trigger Property="IsMouseOver" Value="true"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}" /> - </Trigger> - <Trigger Property="IsPressed" Value="true"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}" /> - <Setter Property="StrokeThickness" TargetName="circle" Value="1.5" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}" /> - </Trigger> - <Trigger Property="IsEnabled" Value="false"> - <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}" /> - <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}" /> - <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}" /> - </Trigger> - </ControlTemplate.Triggers> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - <Style x:Key="ExpanderStyle1" TargetType="{x:Type Expander}"> - <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" /> - <Setter Property="Background" Value="Transparent" /> - <Setter Property="HorizontalContentAlignment" Value="Stretch" /> - <Setter Property="VerticalContentAlignment" Value="Stretch" /> - <Setter Property="BorderBrush" Value="Transparent" /> - <Setter Property="BorderThickness" Value="1" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="{x:Type Expander}"> - <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" - Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="true"> - <DockPanel> - <ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" - ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" Content="{TemplateBinding Header}" - DockPanel.Dock="Top" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" - FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FontStyle="{TemplateBinding FontStyle}" - FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" - FontFamily="{TemplateBinding FontFamily}" - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" - IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" - MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" - Style="{StaticResource ExpanderDownHeaderStyle}" - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> - <ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" - Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> - </DockPanel> - </Border> - <ControlTemplate.Triggers> - <Trigger Property="IsExpanded" Value="true"> - <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" /> - </Trigger> - <Trigger Property="ExpandDirection" Value="Right"> - <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right" /> - <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left" /> - <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}" /> - </Trigger> - <Trigger Property="ExpandDirection" Value="Up"> - <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top" /> - <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom" /> - <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}" /> - </Trigger> - <Trigger Property="ExpandDirection" Value="Left"> - <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left" /> - <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right" /> - <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}" /> - </Trigger> - <Trigger Property="IsEnabled" Value="false"> - <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /> - </Trigger> - </ControlTemplate.Triggers> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - </UserControl.Resources> <DockPanel> @@ -458,10 +199,6 @@ <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - - <!--<Border BorderBrush="White" BorderThickness="1" CornerRadius="4"> - <Border BorderBrush="#D5DFE5" BorderThickness="1" CornerRadius="3"> - <Border BorderBrush="White" BorderThickness="1" CornerRadius="2"> --> <ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Stretch" Margin="10,0,10,10" Background="{x:Static SystemColors.ControlLightBrush}"> @@ -472,21 +209,21 @@ </Style> </ItemsControl.ItemContainerStyle> <ItemsControl.Resources> - <DataTemplate DataType="{x:Type ViewModel:VectoXMLFile}"> + <DataTemplate DataType="{x:Type viewModel:VectoXMLFile}"> <Border BorderBrush="White" BorderThickness="1" CornerRadius="2"> <Expander Margin="2" Header="{Binding}" HorizontalAlignment="Stretch" - Style="{DynamicResource ExpanderStyle1}" + Style="{DynamicResource HeaderStretchExpanderStyle}" HeaderTemplate="{DynamicResource ExpanderHeader}" ContentTemplate="{DynamicResource ExpanderContentJobFile}" Content="{Binding}" /> </Border> </DataTemplate> - <DataTemplate DataType="{x:Type ViewModel:ReportXMLFile}"> + <DataTemplate DataType="{x:Type viewModel:ReportXMLFile}"> <Border BorderBrush="White" BorderThickness="1" CornerRadius="2" Margin="0,0,3,0"> <Expander Margin="2" Header="{Binding}" HorizontalAlignment="Stretch" - Style="{DynamicResource ExpanderStyle1}" + Style="{DynamicResource HeaderStretchExpanderStyle}" HeaderTemplate="{DynamicResource ExpanderHeader}" ContentTemplate="{DynamicResource ExpanderContentReport}" Content="{Binding}" /> </Border> @@ -497,9 +234,7 @@ </ItemsControl> </ScrollViewer> - <!-- </Border> - </Border> - </Border>--> + <Grid Grid.Row="1" Margin="10,3,10,30" HorizontalAlignment="Center"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" />