示例#1
0
        /// <summary>
        /// This method will be called if the view was toggled.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void onToggleView(object sender, ViewTypeEventArgs e)
        {
            if (this.vtype == e.viewType)
                return;

            this.vtype = e.viewType;
            switch (vtype)
            {
                case ViewType.FilterView:
                    this.gridPlayer1.Visibility = System.Windows.Visibility.Visible;
                    this.gridPlayer2.Visibility = System.Windows.Visibility.Collapsed;
                    this.otherPanel.Visibility = System.Windows.Visibility.Collapsed;
                    this.gridMacro.Visibility = System.Windows.Visibility.Visible;
                    break;
                case ViewType.MetricView:
                    this.gridPlayer1.Visibility = System.Windows.Visibility.Visible;
                    this.gridPlayer2.Visibility = System.Windows.Visibility.Visible;
                    this.otherPanel.Visibility = System.Windows.Visibility.Collapsed;
                    this.gridMacro.Visibility = System.Windows.Visibility.Visible;
                    break;
                case ViewType.AnalyzeView:
                    this.gridPlayer1.Visibility = System.Windows.Visibility.Visible;
                    this.gridPlayer2.Visibility = System.Windows.Visibility.Collapsed;
                    this.otherPanel.Visibility = System.Windows.Visibility.Visible;
                    this.gridMacro.Visibility = System.Windows.Visibility.Collapsed;
                    break;
            }
        }
示例#2
0
 /// <summary>
 /// Can be used to check if all viewmodels have disconnected or connected
 /// acoording to the current view.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void onToggleView(object sender, ViewTypeEventArgs e)
 {
     if (e.viewType != currentView)
     {
         switch (e.viewType)
         {
             case ViewType.WelcomeView:
                 welcomePanel.Visibility = Visibility.Visible;
                 runningAppPanel.Visibility = Visibility.Collapsed;
                 break;
             case ViewType.MetricView:
                 this.tabMetric.IsSelected = true;
                 welcomePanel.Visibility = Visibility.Collapsed;
                 runningAppPanel.Visibility = Visibility.Visible;
                 break;
             case ViewType.FilterView:
                 this.tabFilter.IsSelected = true;
                 welcomePanel.Visibility = Visibility.Collapsed;
                 runningAppPanel.Visibility = Visibility.Visible;
                 break;
             case ViewType.AnalyzeView:
                 welcomePanel.Visibility = Visibility.Collapsed;
                 runningAppPanel.Visibility = Visibility.Visible;
                 break;
         }
     }
 }