Make loading custom XAML safer

This commit is contained in:
Matt Nadareski
2021-06-30 16:06:09 -07:00
parent cfb2d316d7
commit afa064e429

View File

@@ -117,10 +117,17 @@ namespace RedBookPlayer.GUI
DataContext = new PlayerViewModel();
// Load the theme
if (xaml != null)
new AvaloniaXamlLoader().Load(xaml, null, this);
else
try
{
if(xaml != null)
new AvaloniaXamlLoader().Load(xaml, null, this);
else
AvaloniaXamlLoader.Load(this);
}
catch
{
AvaloniaXamlLoader.Load(this);
}
InitializeDigits();