Skip to content

Commit

Permalink
Show version in the title
Browse files Browse the repository at this point in the history
  • Loading branch information
gknyihar committed Jun 28, 2024
1 parent 11f4c54 commit d703b6b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
20 changes: 13 additions & 7 deletions SvgToXaml/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
using System.Windows;
using SvgToXaml.Properties;
using SvgToXaml.ViewModels;
using System.Deployment.Application;

namespace SvgToXaml
{
//todo: github oder codeplex anlegen
//todo: Fehlerbehandlung beim Laden
//todo: github oder codeplex anlegen
//todo: Fehlerbehandlung beim Laden

/// <summary>
/// Interaction logic for MainWindow.xaml
Expand All @@ -18,14 +19,19 @@ public MainWindow()
{
InitializeComponent();
DataContext = new SvgImagesViewModel();
((SvgImagesViewModel) DataContext).CurrentDir = Settings.Default.LastDir;
((SvgImagesViewModel)DataContext).CurrentDir = Settings.Default.LastDir;
try
{
Title += " " + ApplicationDeployment.CurrentDeployment.CurrentVersion;
}
catch (InvalidDeploymentException) { }
}


protected override void OnClosing(CancelEventArgs e)
{
//Save current Dir for next Start
Settings.Default.LastDir = ((SvgImagesViewModel) DataContext).CurrentDir;
Settings.Default.LastDir = ((SvgImagesViewModel)DataContext).CurrentDir;
Settings.Default.Save();

base.OnClosing(e);
Expand All @@ -41,7 +47,7 @@ private void MainWindow_OnDrop(object sender, DragEventArgs e)
{
if (Directory.Exists(path))
{
((SvgImagesViewModel) DataContext).CurrentDir = path;
((SvgImagesViewModel)DataContext).CurrentDir = path;
}
else
{
Expand All @@ -55,5 +61,5 @@ private void MainWindow_OnDrop(object sender, DragEventArgs e)
}
}


}
7 changes: 5 additions & 2 deletions SvgToXaml/SvgToXaml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>4</ApplicationRevision>
<UpdateUrl></UpdateUrl>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.htm</WebPage>
<ApplicationRevision>5</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down Expand Up @@ -81,6 +83,7 @@
<Reference Include="SharpVectors.Rendering.Wpf, Version=1.2.0.0, Culture=neutral, PublicKeyToken=d0902381100df30e" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
Expand Down

0 comments on commit d703b6b

Please sign in to comment.