Пример #1
0
        private async void ChangeThemeButton_Click(object sender, RoutedEventArgs e)
        {
            List <string> MomentList = new List <string>();

            for (int i = 0; i < ThemeInfos.Count; i++)
            {
                MomentList.Add(ThemeInfos[i].Name);
            }

            ListSelection inputDialog = new ListSelection(this, MomentList, "Select a theme");

            MainGrid.Children.Add(inputDialog);
            while (true)
            {
                if (inputDialog.SelectionMade)
                {
                    if (inputDialog.SelectedIndex != -1)
                    {
                        Application.Current.Resources.MergedDictionaries.Clear();
                        Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
                        {
                            Source = new Uri("/Themes/" + ThemeInfos[inputDialog.SelectedIndex].URI, UriKind.Relative)
                        });
                        CurrentThemeIndex = inputDialog.SelectedIndex;
                        RefreshModeChange = true;
                    }
                    MainGrid.Children.Remove(inputDialog);
                    break;
                }
                await Task.Delay(100);
            }
        }
Пример #2
0
        private async void ChangeModeButton_Click(object sender, RoutedEventArgs e)
        {
            List <string> MomentList = new List <string>();

            for (int i = 0; i < GraphModes.Count; i++)
            {
                MomentList.Add(GraphModes[i].Name);
            }

            ListSelection inputDialog = new ListSelection(this, MomentList, "Select a mode");

            MainGrid.Children.Add(inputDialog);
            while (true)
            {
                if (inputDialog.SelectionMade)
                {
                    if (inputDialog.SelectedIndex != -1)
                    {
                        CurrentGraphMode      = inputDialog.SelectedIndex;
                        RefreshModeChange     = true;
                        GraphTopLabel.Content = GraphModes[CurrentGraphMode].Name;
                        RunCommandList(CurrentGraphMode, GraphModes[CurrentGraphMode].GraphModeCommandList, null, null, 0);
                    }
                    MainGrid.Children.Remove(inputDialog);
                    break;
                }
                await Task.Delay(100);
            }
        }