diff --git a/ModAssistant/Classes/Themes.cs b/ModAssistant/Classes/Themes.cs index 0dae42a..2ed42d7 100644 --- a/ModAssistant/Classes/Themes.cs +++ b/ModAssistant/Classes/Themes.cs @@ -255,10 +255,17 @@ namespace ModAssistant if (isXaml) { - Uri resourceSource = new Uri(info.FullName); - ResourceDictionary dictionary = new ResourceDictionary(); - dictionary.Source = resourceSource; - theme.ThemeDictionary = dictionary; + try + { + Uri resourceSource = new Uri(info.FullName); + ResourceDictionary dictionary = new ResourceDictionary(); + dictionary.Source = resourceSource; + theme.ThemeDictionary = dictionary; + }catch(Exception ex) + { + string message = string.Format((string)Application.Current.FindResource("Themes:FailedToLoadXaml"), name, ex.Message); + MessageBox.Show(message); + } } if (supportedVideoExtensions.Contains(info.Extension)) @@ -371,7 +378,8 @@ namespace ModAssistant } catch (Exception ex) { - MessageBox.Show($"Could not load {name}.\n\n{ex.Message}\n\nIgnoring..."); + string message = string.Format((string)Application.Current.FindResource("Themes:FailedToLoadXaml"), name, ex.Message); + MessageBox.Show(message); } } } diff --git a/ModAssistant/Localisation/en-DEBUG.xaml b/ModAssistant/Localisation/en-DEBUG.xaml index 43248ba..1c705c5 100644 --- a/ModAssistant/Localisation/en-DEBUG.xaml +++ b/ModAssistant/Localisation/en-DEBUG.xaml @@ -149,6 +149,7 @@ {0} Themes:ThemeMissing Themes:SavedTemplateTheme {0} Themes:TemplateThemeExists + Themes:FailedToLoadXaml {0} {1} Updater:CheckFailed diff --git a/ModAssistant/Localisation/en-US.xaml b/ModAssistant/Localisation/en-US.xaml index 5bce64f..259c5bf 100644 --- a/ModAssistant/Localisation/en-US.xaml +++ b/ModAssistant/Localisation/en-US.xaml @@ -208,6 +208,7 @@ {0} does not exist. Template theme "{0}" saved to Themes folder. Template theme already exists! + Failed to load .xaml file for theme {0}: {1} Couldn't check for updates.