Inheritance: INotifyPropertyChanged
Esempio n. 1
0
    /// <summary>
    /// Initializes UI.
    /// </summary>
    public MainWindow() {
      InitializeComponent();

      InitDataDir();
      modelSelector = new ModelSelector(modelDir);

      keyActions = new Dictionary<Key, Action>() {
        {Key.Space, RecordGesture}, {Key.D, ToggleDebugDisplayOption}, {Key.E, ExecuteOfflineProcessor},
        {Key.H, ToggleViewHog}, {Key.K, ToggleViewSkeleton}, {Key.N, StepForward}, {Key.P, TogglePlay}, 
        {Key.R, RefreshModel}, {Key.S, StartKinect}, {Key.T, StartTracking}, 
      };
      labelKeys.Content = GetKeyOptionString();

      trainingManager.TrainingEvent += OnTrainingEvent;
      trainingGroupBox.DataContext = trainingManager;

      var binding = new Binding("Status");
      binding.Converter = new ColorConverter();
      statusTextBlock.SetBinding(TextBlock.ForegroundProperty, binding);

      speechTextBlock.DataContext = this;
      binding = new Binding("SpeechJson");
      binding.Converter = new ColorConverter();
      speechTextBlock.SetBinding(TextBlock.ForegroundProperty, binding);

      modelComboBox.DataContext = modelSelector;
      modelComboBox.SelectedItem = modelSelector.SelectedModel;
      modelSelector.PropertyChanged += ModelSelectorSelectedItemChanged;

      kinectDisplay.DataContext = colorManager;
      maskDispay.DataContext = debugColorDisplayManager;
      depthDisplay.DataContext = depthManager;

      inputServer.Start();
    }
Esempio n. 2
0
        /// <summary>
        /// Initializes UI.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            InitDataDir();
            modelSelector = new ModelSelector(modelDir);

            keyActions = new Dictionary <Key, Action>()
            {
                { Key.Space, RecordGesture }, { Key.D, ToggleDebugDisplayOption }, { Key.E, ExecuteOfflineProcessor },
                { Key.H, ToggleViewHog }, { Key.K, ToggleViewSkeleton }, { Key.N, StepForward }, { Key.P, TogglePlay },
                { Key.R, RefreshModel }, { Key.S, StartKinect }, { Key.T, StartTracking },
            };
            labelKeys.Content = GetKeyOptionString();

            trainingManager.TrainingEvent += OnTrainingEvent;
            trainingGroupBox.DataContext   = trainingManager;

            var binding = new Binding("Status");

            binding.Converter = new ColorConverter();
            statusTextBlock.SetBinding(TextBlock.ForegroundProperty, binding);

            speechTextBlock.DataContext = this;
            binding           = new Binding("SpeechJson");
            binding.Converter = new ColorConverter();
            speechTextBlock.SetBinding(TextBlock.ForegroundProperty, binding);

            modelComboBox.DataContext      = modelSelector;
            modelComboBox.SelectedItem     = modelSelector.SelectedModel;
            modelSelector.PropertyChanged += ModelSelectorSelectedItemChanged;

            kinectDisplay.DataContext = colorManager;
            maskDispay.DataContext    = debugColorDisplayManager;
            depthDisplay.DataContext  = depthManager;

            inputServer.Start();
        }