Пример #1
0
 private IAsyncAction SetTitleBarColors()
 {
     return(_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         var theme = Application.Current.RequestedTheme == ApplicationTheme.Light ? ElementTheme.Light : ElementTheme.Dark;
         ContrastHelper.SetTitleBarButtonsForTheme(theme);
     }));
 }
 private Task SetTitleBarColorsAsync()
 {
     return(_dispatcher.ExecuteAsync(() =>
     {
         var theme = Application.Current.RequestedTheme == ApplicationTheme.Light ? ElementTheme.Light : ElementTheme.Dark;
         ContrastHelper.SetTitleBarButtonsForTheme(theme);
     }));
 }
Пример #3
0
        private void SetTheme(ElementTheme theme)
        {
            SetActiveButton.RequestedTheme = theme;
            EditButton.RequestedTheme      = theme;
            DeleteButton.RequestedTheme    = theme;
            SaveButton.RequestedTheme      = theme;
            CancelButton.RequestedTheme    = theme;
            ExportButton.RequestedTheme    = theme;

            ContrastHelper.SetTitleBarButtonsForTheme(theme);
        }
Пример #4
0
        public MainPage()
        {
            InitializeComponent();
            Root.DataContext = this;
            Window.Current.SetTitleBar(TitleBar);
            Loaded   += OnLoaded;
            Unloaded += OnUnloaded;
            Window.Current.Activated += OnWindowActivated;
            RegisterPropertyChangedCallback(RequestedThemeProperty, (s, e) =>
            {
                ContrastHelper.SetTitleBarButtonsForTheme(RequestedTheme);
            });

            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.Auto;
        }
Пример #5
0
 private void OnRequestedThemeProperty(DependencyObject sender, DependencyProperty dp)
 {
     ContrastHelper.SetTitleBarButtonsForTheme(RequestedTheme);
 }