예제 #1
0
        private void ChangeTheme()
        {
            switch (SettingHelper.Get_Rigth())
            {
            case 1:
                bg_Frame.Navigate(typeof(FastNavigatePage));
                break;

            case 2:
                bg_Frame.Navigate(typeof(PartPage));
                break;

            case 3:
                bg_Frame.Navigate(typeof(RankPage));
                break;

            case 4:
                bg_Frame.Navigate(typeof(TimelinePage));
                break;

            case 5:
                bg_Frame.Navigate(typeof(LiveAllPage));
                break;

            default:
                bg_Frame.Navigate(typeof(BlankPage));
                break;
            }



            string             ThemeName     = SettingHelper.Get_Theme();
            ResourceDictionary newDictionary = new ResourceDictionary();

            switch (ThemeName)
            {
            case "Dark":
                RequestedTheme = ElementTheme.Dark;

                break;

            case "Red":

                newDictionary.Source = new Uri("ms-appx:///Theme/RedTheme.xaml", UriKind.RelativeOrAbsolute);
                Application.Current.Resources.MergedDictionaries.Clear();
                Application.Current.Resources.MergedDictionaries.Add(newDictionary);
                RequestedTheme = ElementTheme.Dark;
                RequestedTheme = ElementTheme.Light;
                break;

            case "Blue":

                newDictionary.Source = new Uri("ms-appx:///Theme/BlueTheme.xaml", UriKind.RelativeOrAbsolute);
                Application.Current.Resources.MergedDictionaries.Clear();
                Application.Current.Resources.MergedDictionaries.Add(newDictionary);
                RequestedTheme = ElementTheme.Dark;
                RequestedTheme = ElementTheme.Light;
                break;

            case "Green":
                newDictionary.Source = new Uri("ms-appx:///Theme/GreenTheme.xaml", UriKind.RelativeOrAbsolute);
                Application.Current.Resources.MergedDictionaries.Clear();
                Application.Current.Resources.MergedDictionaries.Add(newDictionary);
                RequestedTheme = ElementTheme.Dark;
                RequestedTheme = ElementTheme.Light;
                break;

            case "Pink":
                newDictionary.Source = new Uri("ms-appx:///Theme/PinkTheme.xaml", UriKind.RelativeOrAbsolute);
                Application.Current.Resources.MergedDictionaries.Clear();
                Application.Current.Resources.MergedDictionaries.Add(newDictionary);
                RequestedTheme = ElementTheme.Dark;
                RequestedTheme = ElementTheme.Light;
                break;

            case "Purple":
                newDictionary.Source = new Uri("ms-appx:///Theme/PurpleTheme.xaml", UriKind.RelativeOrAbsolute);
                Application.Current.Resources.MergedDictionaries.Clear();
                Application.Current.Resources.MergedDictionaries.Add(newDictionary);
                RequestedTheme = ElementTheme.Dark;
                RequestedTheme = ElementTheme.Light;
                break;

            case "Yellow":
                newDictionary.Source = new Uri("ms-appx:///Theme/YellowTheme.xaml", UriKind.RelativeOrAbsolute);
                Application.Current.Resources.MergedDictionaries.Clear();
                Application.Current.Resources.MergedDictionaries.Add(newDictionary);
                RequestedTheme = ElementTheme.Dark;
                RequestedTheme = ElementTheme.Light;
                break;

            case "EMT":
                newDictionary.Source = new Uri("ms-appx:///Theme/EMTTheme.xaml", UriKind.RelativeOrAbsolute);

                Application.Current.Resources.MergedDictionaries.Clear();
                Application.Current.Resources.MergedDictionaries.Add(newDictionary);
                // img_Hello.Source = new BitmapImage(new Uri("ms-appx:///Assets/Logo/EMT.png"));
                RequestedTheme = ElementTheme.Dark;
                RequestedTheme = ElementTheme.Light;
                break;
            }
            //tuic.To = this.ActualWidth;
            //storyboardPopOut.Begin();
            ChangeTitbarColor();
        }