diff --git a/HashingTool/ViewModel/VerifyComponentInputDataViewModel.cs b/HashingTool/ViewModel/VerifyComponentInputDataViewModel.cs index 1d92a56739f6959de2f6b37d994699235d1fd449..722df4708706aa79b1760c066743f8352eb385cb 100644 --- a/HashingTool/ViewModel/VerifyComponentInputDataViewModel.cs +++ b/HashingTool/ViewModel/VerifyComponentInputDataViewModel.cs @@ -13,6 +13,7 @@ namespace HashingTool.ViewModel { public class VerifyComponentInputDataViewModel : HashedXMLFile, IMainView, INotifyPropertyChanged { + private string _certificationNumber; //private bool _componentDataValid; public VerifyComponentInputDataViewModel() @@ -26,6 +27,17 @@ namespace HashingTool.ViewModel get { return ApplicationViewModel.HomeView; } } + public string CertificationNumber + { + get { return _certificationNumber; } + private set { + if (_certificationNumber == value) + return; + _certificationNumber = value; + RaisePropertyChanged("CertificationNumber"); + } + } + private void ComponentFilechanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == GeneralUpdate) { @@ -47,6 +59,7 @@ namespace HashingTool.ViewModel throw new InvalidDataException(); } Component = h.GetContainigComponents().First().XMLElementName(); + CertificationNumber = h.GetCertificationNumber(h.GetContainigComponents().First(), 0); } catch (Exception e) { Component = ""; _xmlFile.LogError(e.Message); diff --git a/HashingTool/Views/VerifyComponentInputData.xaml b/HashingTool/Views/VerifyComponentInputData.xaml index eaf1d1b1bfdada225fdfb9f1d06ae2625cb56b43..6ab2c8aad7f85a370acd986df7930a59f5a0027f 100644 --- a/HashingTool/Views/VerifyComponentInputData.xaml +++ b/HashingTool/Views/VerifyComponentInputData.xaml @@ -7,7 +7,7 @@ xmlns:views="clr-namespace:HashingTool.Views" xmlns:helper="clr-namespace:HashingTool.Helper" x:Class="HashingTool.Views.VerifyComponentInputData" - mc:Ignorable="d" d:DesignWidth="534" d:DesignHeight="290"> + mc:Ignorable="d" d:DesignWidth="604" d:DesignHeight="462"> <UserControl.Resources> <helper:CollectionConverter x:Key="CollectionConverter" /> </UserControl.Resources> @@ -56,6 +56,8 @@ <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" MinWidth="100" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> @@ -67,24 +69,28 @@ <RowDefinition Height="*" /> </Grid.RowDefinitions> - <Label Grid.Row="0" Grid.Column="0" Content="Certification Date:" /> - <TextBox Grid.Row="0" Grid.Column="1" Text="{helper:CultureAwareBinding Path=Date, StringFormat='g'}" Margin="10,2" IsReadOnly="True" /> + <Label Grid.Row="0" Grid.Column="0" Content="Certification Number:" Margin="0"/> + <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding CertificationNumber, Mode=OneWay}" + Margin="10,2" IsReadOnly="True" /> + + <Label Grid.Row="0" Grid.Column="2" Content="Date:" /> + <TextBox Grid.Row="0" Grid.Column="3" Text="{helper:CultureAwareBinding Path=Date, StringFormat='g'}" Margin="10,2" IsReadOnly="True" /> <Label Grid.Row="1" Grid.Column="0" Content="Component:" /> - <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Component}" Margin="10,2" IsReadOnly="True" /> + <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Component}" Margin="10,2" IsReadOnly="True" /> <Label Grid.Row="2" Grid.Column="0" Content="Canonicalization methods:" /> - <TextBox Grid.Row="2" Grid.Column="1" + <TextBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding CanonicalizationMethods, Mode=OneWay, Converter={StaticResource CollectionConverter}}" Margin="10,2" IsReadOnly="True" /> <Label Grid.Row="3" Grid.Column="0" Content="Digest method:" /> - <TextBox Grid.Row="3" Grid.Column="1" + <TextBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding DigestMethod ,Mode=OneWay}" Margin="10,2" IsReadOnly="True" /> <Label Grid.Row="4" Grid.Column="0" Content="Digest Value read:" Style="{StaticResource DigestValueLabelStyle}" /> - <TextBox Grid.Row="4" Grid.Column="1" Text="{Binding DigestValueRead}" Margin="10,2" IsReadOnly="True"> + <TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding DigestValueRead}" Margin="10,2" IsReadOnly="True"> <TextBox.Style> <Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}"> <Style.Triggers> @@ -101,7 +107,7 @@ <Label Grid.Row="5" Grid.Column="0" Content="Digest Value computed:" Style="{StaticResource DigestValueLabelStyle}" /> - <TextBox Grid.Row="5" Grid.Column="1" Text="{Binding DigestValueComputed}" Margin="10,2" IsReadOnly="True"> + <TextBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding DigestValueComputed}" Margin="10,2" IsReadOnly="True"> <TextBox.Style> <Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}"> <Style.Triggers>