private void SelectXamlFile(XamlFileSelector selector, string fileName) { foreach (var file in selector.Files) { if (file != fileName) { continue; } selector.File = file; break; } }
private void SetupResources() { var launcherFolder = AppContext.BaseDirectory; var languageSelector = new XamlFileSelector($"{launcherFolder}\\Assets\\Languages"); var themeSelector = new XamlFileSelector($"{launcherFolder}\\Theme"); LibraryBindings.Init(languageSelector, themeSelector); // Ideally this should be in Setup, however the download dialogs should be localized. Resources.MergedDictionaries.Add(languageSelector); Resources.MergedDictionaries.Add(themeSelector); themeSelector.NewFileSet += OnThemeChanged; Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri($"{launcherFolder}\\Theme\\Helpers\\BackwardsCompatibilityHelpers.xaml", UriKind.RelativeOrAbsolute) }); }