Skip to content

Commit

Permalink
Merge pull request #2112 from Remolutionary/remolution
Browse files Browse the repository at this point in the history
If the user.config file is corrupt the whole application crashes
  • Loading branch information
punker76 committed Sep 5, 2015
2 parents 96b1e8c + 96a52f1 commit f0f5479
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
12 changes: 10 additions & 2 deletions MahApps.Metro/Controls/WindowSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,17 @@ public bool UpgradeSettings
{
get
{
if (this["UpgradeSettings"] != null)
try
{
return (bool)this["UpgradeSettings"];
if (this["UpgradeSettings"] != null)
{
return (bool)this["UpgradeSettings"];
}
}
catch (ConfigurationErrorsException ex)
{
var filename = ((ConfigurationErrorsException)ex.InnerException).Filename;
throw new MahAppsException(string.Format("The settings file {0} seems to be corrupted", filename), ex);
}
return true;
}
Expand Down
1 change: 1 addition & 0 deletions MahApps.Metro/MahApps.Metro.NET45.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Lib\NET45\System.Windows.Interactivity.dll</HintPath>
Expand Down
1 change: 1 addition & 0 deletions MahApps.Metro/MahApps.Metro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Lib\NET40\System.Windows.Interactivity.dll</HintPath>
Expand Down
1 change: 1 addition & 0 deletions samples/MetroDemo/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
d:DataContext="{d:DesignInstance MetroDemo:MainWindowViewModel}"
Closing="MetroWindow_Closing"
Dialog:DialogParticipation.Register="{Binding}"
SaveWindowPosition="True"
>

<Window.Resources>
Expand Down

0 comments on commit f0f5479

Please sign in to comment.