using System.Collections.Generic; using System.Linq; using StrixMusic.Sdk.Services.Navigation; using StrixMusic.Sdk.WinUI.Controls.Shells; using StrixMusic.Shells.ZuneDesktop.Settings; using Windows.ApplicationModel.Resources; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; namespace StrixMusic.Shells.ZuneDesktop.Controls.Views.Settings { /// /// The Settings page in the ZuneDesktop shell. /// public sealed partial class SettingsView : UserControl { private readonly INavigationService _navigationService; /// /// Initializes a new instance of the class. /// public SettingsView() { this.InitializeComponent(); _navigationService = Shell.Ioc.GetRequiredService>(); var localizationService = ResourceLoader.GetForCurrentView("StrixMusic.Shells.ZuneDesktop/ZuneSettings"); _displayPages = _displayPages.Select(x => localizationService.GetString(x).ToUpper()).ToList(); } private ZuneDesktopSettingsViewModel? ViewModel => DataContext as ZuneDesktopSettingsViewModel; /// /// Translated in constructor. /// private readonly IEnumerable _displayPages = new string[] { "Background", "Scale", }; private readonly List _behaviorPages = new List() { "MERGE BY", }; private void SaveClicked(object sender, RoutedEventArgs e) { // TODO: Save settings changes _navigationService.GoBack(); } private void CancelClicked(object sender, RoutedEventArgs e) { //TODO: Revert unsaved changes _navigationService.GoBack(); } private void NavigateToDisplay(object sender, RoutedEventArgs e) { PagesList.ItemsSource = _displayPages; } private void NavigateToBehavior(object sender, RoutedEventArgs e) { PagesList.ItemsSource = _behaviorPages; } } }