/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.8
tests/Files.App.UITests/MainWindow.xaml.cs
57 строк
1 KB
0x5BFA
Code Quality: Added hierarchical page navigation to UI Test app (#15879)
11 авг 2024, 19:58
Не верифицирован
11 авг 2024, 19:58
c449eba
Код
Авторство
О чём код?
// Copyright (c) 2024 Files Community // Licensed under the MIT License. See the LICENSE. using Files.App.UITests.Views; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; namespace Files.App.UITests { public sealed partial class MainWindow : Window { private static MainWindow? _Instance; public static MainWindow Instance => _Instance ??= new(); private MainWindow() { InitializeComponent(); ExtendsContentIntoTitleBar = true; MainFrame.Navigate(typeof(MainPage)); } private void NavigationView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) { if (args.SelectedItem is not NavigationViewItem item || item.Tag is not string tag) return; switch (tag) { case "ThemedIconPage": MainFrame.Navigate(typeof(ThemedIconPage)); break; } } private void ThemeModeSelectorCombBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (sender is not ComboBox comboBox || Content is not FrameworkElement element) return; switch (comboBox.SelectedIndex) { case 0: element.RequestedTheme = ElementTheme.Default; break; case 1: element.RequestedTheme = ElementTheme.Light; break; case 2: element.RequestedTheme = ElementTheme.Dark; break; } } } }