Esempio n. 1
0
 private void UpdateColorWhenSizeChanged()
 {
     if (Window.Current.Bounds.Width >= WIDTH_THRESHOLD)
     {
         if (!_isToggleAnim1)
         {
             ChangeColorAnim.To   = Colors.White;
             ChangeColorAnim.From = (HeaderContentRootGrid.Background as SolidColorBrush).Color;
             ChangeColorStory.Begin();
             _isToggleAnim1 = true;
             _isToggleAnim2 = false;
             ToggleDrawerAnimation(true);
         }
         HamburgerBtn.ForegroundBrush = MainVM.CateColor;
         TitleTB.Foreground           = MainVM.CateColor;
         ProgressRing.Foreground      = MainVM.CateColor;
         TitleBarHelper.SetUpTitleBarColorForDarkText();
     }
     else
     {
         if (!_isToggleAnim2)
         {
             ChangeColorAnim.To   = MainVM.CateColor.Color;
             ChangeColorAnim.From = Colors.White;
             ChangeColorStory.Begin();
             _isToggleAnim2 = true;
             _isToggleAnim1 = false;
             ToggleDrawerAnimation(false);
         }
         HamburgerBtn.ForegroundBrush = new SolidColorBrush(Colors.White);
         TitleTB.Foreground           = new SolidColorBrush(Colors.White);
         ProgressRing.Foreground      = new SolidColorBrush(Colors.White);
         TitleBarHelper.SetUpTitleBarColorForLightText();
     }
 }
Esempio n. 2
0
 private void MainVM_OnCategoryChanged()
 {
     if (Window.Current.Bounds.Width >= 720)
     {
         HamburgerBtn.ForegroundBrush = MainVM.CateColor;
         TitleTB.Foreground           = MainVM.CateColor;
         ProgressRing.Foreground      = MainVM.CateColor;
         TitleBarHelper.SetUpTitleBarColorForDarkText();
     }
     else
     {
         var solidColor = HeaderContentRootGrid.Background as SolidColorBrush;
         if (solidColor == null)
         {
             return;
         }
         if (solidColor.Color != MainVM.CateColor.Color)
         {
             ChangeColorAnim.To   = MainVM.CateColor.Color;
             ChangeColorAnim.From = Colors.White;
             ChangeColorStory.Begin();
         }
         HamburgerBtn.ForegroundBrush = new SolidColorBrush(Colors.White);
         TitleTB.Foreground           = new SolidColorBrush(Colors.White);
         ProgressRing.Foreground      = new SolidColorBrush(Colors.White);
         TitleBarHelper.SetUpTitleBarColorForLightText();
     }
 }