From d9dcb974a47cf6580f578effd3cf04067e3f2079 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Tue, 19 Sep 2017 11:05:24 +0200
Subject: [PATCH] adding about dialog

---
 HashingTool/HashingTool.csproj                |  7 +++
 HashingTool/MainWindow.xaml                   | 46 ++++++++++++---
 HashingTool/MainWindow.xaml.cs                | 16 ++++++
 HashingTool/ViewModel/ApplicationViewModel.cs |  3 +-
 HashingTool/Views/AboutDialog.xaml            | 57 +++++++++++++++++++
 HashingTool/Views/AboutDialog.xaml.cs         | 28 +++++++++
 .../VectoHashing/Properties/Version.cs        |  4 +-
 .../VectoHashing/Properties/Version.tt        |  4 +-
 8 files changed, 153 insertions(+), 12 deletions(-)
 create mode 100644 HashingTool/Views/AboutDialog.xaml
 create mode 100644 HashingTool/Views/AboutDialog.xaml.cs

diff --git a/HashingTool/HashingTool.csproj b/HashingTool/HashingTool.csproj
index 751fae6c4e..89e5566db3 100644
--- a/HashingTool/HashingTool.csproj
+++ b/HashingTool/HashingTool.csproj
@@ -88,6 +88,9 @@
     <Compile Include="ViewModel\UserControl\XMLFile.cs" />
     <Compile Include="Util\XMLValidator.cs" />
     <Compile Include="ViewModel\VerifyResultDataViewModel.cs" />
+    <Compile Include="Views\AboutDialog.xaml.cs">
+      <DependentUpon>AboutDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\HashComponentData.xaml.cs">
       <DependentUpon>HashComponentData.xaml</DependentUpon>
     </Compile>
@@ -153,6 +156,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\AboutDialog.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/MainWindow.xaml b/HashingTool/MainWindow.xaml
index fe0aed3a1f..14a2e02c5a 100644
--- a/HashingTool/MainWindow.xaml
+++ b/HashingTool/MainWindow.xaml
@@ -28,13 +28,15 @@
 	<DockPanel>
 		<Grid DockPanel.Dock="Top" Height="100">
 			<Grid.ColumnDefinitions>
-				<ColumnDefinition Width="256"/>
-				<ColumnDefinition Width="*"/>
+				<ColumnDefinition Width="256" />
+				<ColumnDefinition Width="*" />
 			</Grid.ColumnDefinitions>
 			<Grid.Background>
-				<ImageBrush ImageSource="Resources/VECTO_Hashing.png" Stretch="None" AlignmentX="Left" AlignmentY="Center"/>
+				<ImageBrush ImageSource="Resources/VECTO_Hashing.png" Stretch="None" AlignmentX="Left" AlignmentY="Center" />
 			</Grid.Background>
-			<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Text="VECTO Hashing Tool" FontSize="38" FontWeight="Bold" Margin="30,20,0,0"/>
+			<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Text="VECTO Hashing Tool"
+						FontSize="38" FontWeight="Bold" Margin="30,20,0,0" />
+			
 		</Grid>
 		<Border DockPanel.Dock="Bottom" BorderThickness="0,1,0,0" BorderBrush="{x:Static SystemColors.ControlDarkDarkBrush}"
 				Margin="2,0">
@@ -52,10 +54,40 @@
 						Source="Resources/JRC-About.png" />
 			</Grid>
 		</Border>
+		<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,10,0">
+			<TextBlock Text="User Manual" HorizontalAlignment="Center" Margin="5" Foreground="Blue"
+							MouseLeftButtonUp="Help_OnMouseLeftButtonUp">
+				<TextBlock.Style>
+					<Style>
+						<Setter Property="TextBlock.TextDecorations" Value="" />
+						<Style.Triggers>
+							<Trigger Property="TextBlock.IsMouseOver" Value="True">
+								<Setter Property="TextBlock.TextDecorations" Value="Underline" />
+								<Setter Property="TextBlock.Cursor" Value="Hand" />
+							</Trigger>
+						</Style.Triggers>
+					</Style>
+				</TextBlock.Style>
+			</TextBlock>
+			<TextBlock Text="About" HorizontalAlignment="Center" Margin="5" Foreground="Blue"
+							MouseLeftButtonUp="About_OnMouseLeftButtonUp">
+				<TextBlock.Style>
+					<Style>
+						<Setter Property="TextBlock.TextDecorations" Value="" />
+						<Style.Triggers>
+							<Trigger Property="TextBlock.IsMouseOver" Value="True">
+								<Setter Property="TextBlock.TextDecorations" Value="Underline" />
+								<Setter Property="TextBlock.Cursor" Value="Hand" />
+							</Trigger>
+						</Style.Triggers>
+					</Style>
+				</TextBlock.Style>
+			</TextBlock>
+		</StackPanel>
 		<!--<ScrollViewer VerticalScrollBarVisibility="Auto">-->
-			<Grid Margin="10">
-				<ContentControl Content="{Binding CurrentViewModel}" />
-			</Grid>
+		<Grid Margin="10">
+			<ContentControl Content="{Binding CurrentViewModel}" />
+		</Grid>
 		<!--</ScrollViewer>-->
 	</DockPanel>
 </Window>
\ No newline at end of file
diff --git a/HashingTool/MainWindow.xaml.cs b/HashingTool/MainWindow.xaml.cs
index f3c6cfc288..9c954fd61e 100644
--- a/HashingTool/MainWindow.xaml.cs
+++ b/HashingTool/MainWindow.xaml.cs
@@ -29,6 +29,10 @@
 *   Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
 */
 
+using System.Windows;
+using System.Windows.Input;
+using HashingTool.Views;
+
 namespace HashingTool
 {
 	/// <summary>
@@ -40,5 +44,17 @@ namespace HashingTool
 		{
 			InitializeComponent();
 		}
+
+		private void About_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+		{
+			var dialog = new AboutDialog();
+
+			dialog.ShowDialog();
+		}
+
+		private void Help_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+		{
+			throw new System.NotImplementedException();
+		}
 	}
 }
diff --git a/HashingTool/ViewModel/ApplicationViewModel.cs b/HashingTool/ViewModel/ApplicationViewModel.cs
index 946a51cfee..88980d4e86 100644
--- a/HashingTool/ViewModel/ApplicationViewModel.cs
+++ b/HashingTool/ViewModel/ApplicationViewModel.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Linq;
+using System.Windows;
 using System.Windows.Input;
 using HashingTool.Views;
 
@@ -15,7 +16,6 @@ namespace HashingTool.ViewModel
 		private IMainView _currentView;
 		public static List<IMainView> AvailableViews;
 
-
 		public ApplicationViewModel()
 		{
 			var homeView = new HomeViewModel();
@@ -58,6 +58,7 @@ namespace HashingTool.ViewModel
 			get { return HomeView; }
 		}
 
+
 		private void ChangeViewModel(IMainView mainView)
 		{
 			if (!MainViewModels.Contains(mainView)) {
diff --git a/HashingTool/Views/AboutDialog.xaml b/HashingTool/Views/AboutDialog.xaml
new file mode 100644
index 0000000000..3906faea5f
--- /dev/null
+++ b/HashingTool/Views/AboutDialog.xaml
@@ -0,0 +1,57 @@
+<Window x:Class="HashingTool.Views.AboutDialog"
+		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+		Height="355" Width="700" Icon="/HashingTool;component/HashingIcon.ico" ResizeMode="NoResize">
+	<DockPanel>
+		<Grid DockPanel.Dock="Top" Height="100">
+			<Grid.ColumnDefinitions>
+				<ColumnDefinition Width="256" />
+				<ColumnDefinition Width="*" />
+			</Grid.ColumnDefinitions>
+			<Grid.Background>
+				<ImageBrush ImageSource="../Resources/VECTO_Hashing.png" Stretch="None" AlignmentX="Left" AlignmentY="Center" />
+			</Grid.Background>
+			<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Text="VECTO Hashing Tool"
+						FontSize="38" FontWeight="Bold" Margin="30,20,0,0" />
+
+		</Grid>
+		<Grid DockPanel.Dock="Bottom" Margin="15, 30, 15, 15">
+			<TextBlock Text="VECTO Hashing Tool is licensed under EUPL 1.1+" Foreground="Blue" TextDecorations="Underline" MouseLeftButtonUp="EUPL_Link">
+				<TextBlock.Style>
+					<Style>
+						<Style.Triggers>
+							<Trigger Property="TextBlock.IsMouseOver" Value="True">
+								<Setter Property="TextBlock.Cursor" Value="Hand" />
+							</Trigger>
+						</Style.Triggers>
+					</Style>
+				</TextBlock.Style>
+			</TextBlock>
+			<TextBlock Text="Copyright © 2017 European Union" Margin="0, 20, 0, 0"/>
+			<TextBlock Text="Developed on behalf of the" Margin="0, 50, 0, 0"/>
+			<StackPanel Orientation="Horizontal" Margin="20,70,20,0" HorizontalAlignment="Center" Height="80" VerticalAlignment="Top">
+				<TextBlock VerticalAlignment="Center" Margin="0,0,60,0">
+					Joint Research Centre<LineBreak/>
+					Sustainable Transport Unit<LineBreak/>
+					European Commission
+				</TextBlock>
+				<Image Source="../Resources/JRC-About.png" Stretch="Uniform" Width="240"/>
+			</StackPanel>
+			<StackPanel Orientation="Horizontal" Margin="0, 155, 0,0">
+				<TextBlock Text="Support Contact:" Margin="0,0,30,0"/>
+				<TextBlock Text="vecto@jrc.ec.europa.com" Foreground="Blue" TextDecorations="Underline" MouseLeftButtonUp="Supportmail">
+					<TextBlock.Style>
+						<Style>
+							<Style.Triggers>
+								<Trigger Property="TextBlock.IsMouseOver" Value="True">
+									<Setter Property="TextBlock.Cursor" Value="Hand" />
+								</Trigger>
+							</Style.Triggers>
+						</Style>
+					</TextBlock.Style>
+
+				</TextBlock>
+			</StackPanel>
+		</Grid>
+	</DockPanel>
+</Window>
\ No newline at end of file
diff --git a/HashingTool/Views/AboutDialog.xaml.cs b/HashingTool/Views/AboutDialog.xaml.cs
new file mode 100644
index 0000000000..c1c8424139
--- /dev/null
+++ b/HashingTool/Views/AboutDialog.xaml.cs
@@ -0,0 +1,28 @@
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Input;
+
+namespace HashingTool.Views
+{
+	/// <summary>
+	/// Interaction logic for AboutDialog.xaml
+	/// </summary>
+	public partial class AboutDialog : Window
+	{
+		public AboutDialog()
+		{
+			InitializeComponent();
+		}
+
+		private void EUPL_Link(object sender, MouseButtonEventArgs e)
+		{
+			Process.Start("https://joinup.ec.europa.eu/community/eupl/og_page/eupl");
+
+		}
+
+		private void Supportmail(object sender, MouseButtonEventArgs e)
+		{
+			Process.Start("mailto:vecto@jrc.ec.europa.eu");
+		}
+	}
+}
diff --git a/VectoCommon/VectoHashing/Properties/Version.cs b/VectoCommon/VectoHashing/Properties/Version.cs
index df76185997..2933498d3d 100644
--- a/VectoCommon/VectoHashing/Properties/Version.cs
+++ b/VectoCommon/VectoHashing/Properties/Version.cs
@@ -30,5 +30,5 @@
 */
 
 using System.Reflection;
-[assembly: AssemblyVersion("1.1.0.940")]
-[assembly: AssemblyFileVersion("1.1.0.940")]
+[assembly: AssemblyVersion("1.2.0.992")]
+[assembly: AssemblyFileVersion("1.2.0.992")]
diff --git a/VectoCommon/VectoHashing/Properties/Version.tt b/VectoCommon/VectoHashing/Properties/Version.tt
index 68598d3638..bb1eeec0af 100644
--- a/VectoCommon/VectoHashing/Properties/Version.tt
+++ b/VectoCommon/VectoHashing/Properties/Version.tt
@@ -32,8 +32,8 @@
 <#@ template language="C#" #>
 <#@ output extension=".cs"#>
 using System.Reflection;
-[assembly: AssemblyVersion("1.1.0.<#= this.RevisionNumber #>")]
-[assembly: AssemblyFileVersion("1.1.0.<#= this.RevisionNumber #>")]
+[assembly: AssemblyVersion("1.2.0.<#= this.RevisionNumber #>")]
+[assembly: AssemblyFileVersion("1.2.0.<#= this.RevisionNumber #>")]
 <#+ 
 	int RevisionNumber = (int)(DateTime.UtcNow - new DateTime(2015, 1, 1)).TotalDays; 
 #>
\ No newline at end of file
-- 
GitLab