Changed About Window to

This commit is contained in:
Ben 2015-06-14 21:11:25 +01:00
parent e0a660fec6
commit 8119018f33
3 changed files with 20 additions and 4 deletions

View File

@ -50,7 +50,7 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.*")] [assembly: AssemblyVersion("0.3.*")]
[assembly: InternalsVisibleTo("Filtration.Tests")] [assembly: InternalsVisibleTo("Filtration.Tests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]

View File

@ -7,7 +7,10 @@
Height="360" Height="360"
Width="580" Width="580"
Loaded="AboutWindow_OnLoaded" Loaded="AboutWindow_OnLoaded"
BorderThickness="1" BorderBrush="Black"> BorderThickness="1"
BorderBrush="Black"
ShowMaxRestoreButton="False"
ShowMinButton="False">
<Grid Margin="15"> <Grid Margin="15">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition>
@ -29,7 +32,7 @@
<Image Source="/Filtration;component/Resources/logo.png" Width="75" Height="75" VerticalAlignment="Top" /> <Image Source="/Filtration;component/Resources/logo.png" Width="75" Height="75" VerticalAlignment="Top" />
<StackPanel Grid.Row="0" Grid.Column="1"> <StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock FontWeight="Black">Filtration</TextBlock> <TextBlock FontWeight="Black">Filtration</TextBlock>
<TextBlock>Version 0.2</TextBlock> <TextBlock Text="{Binding Version}" />
<TextBlock>Copyright © 2015</TextBlock> <TextBlock>Copyright © 2015</TextBlock>
<TextBlock>Created by Ben Wallis</TextBlock> <TextBlock>Created by Ben Wallis</TextBlock>
<TextBlock> <TextBlock>

View File

@ -1,4 +1,6 @@
using System.Windows; using System.Diagnostics;
using System.Reflection;
using System.Windows;
namespace Filtration.Views namespace Filtration.Views
{ {
@ -7,6 +9,7 @@ namespace Filtration.Views
public AboutWindow() public AboutWindow()
{ {
InitializeComponent(); InitializeComponent();
DataContext = this;
} }
private void AboutWindow_OnLoaded(object sender, RoutedEventArgs e) private void AboutWindow_OnLoaded(object sender, RoutedEventArgs e)
@ -16,5 +19,15 @@ namespace Filtration.Views
Left = mainWindow.Left + (mainWindow.Width - ActualWidth) / 2; Left = mainWindow.Left + (mainWindow.Width - ActualWidth) / 2;
Top = mainWindow.Top + (mainWindow.Height - ActualHeight) / 2; Top = mainWindow.Top + (mainWindow.Height - ActualHeight) / 2;
} }
public string Version
{
get
{
var assembly = Assembly.GetExecutingAssembly();
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
return "Version " + fvi.FileMajorPart + "." + fvi.FileMinorPart;
}
}
} }
} }