Пример #1
0
 public StatesScreen(Window MainWindow, KinectSensorChooser SensorChooser, Constants.TimeZones TimeZone)
 {
     // Get the main window and sensor objects
     this.mainWindow = MainWindow;
     this.sensorChooser = SensorChooser;
     // Populate the states based on TimeZone parameter
     this.timeZone = TimeZone;
     this.states = PopulateStates(TimeZone);
     #if (DEBUG)
     Console.WriteLine(TimeZone.ToString() + " states loading...");
     foreach (Utilities.State s in this.states)
     {
         Console.WriteLine(s);
     }
     Console.WriteLine("..." + TimeZone.ToString() + " states loaded!");
     #endif
     // Initialize display containers
     CreateContentGrid();
     CreateKinectRegion();
     CreateInfoGrid();
     CreateKinectScrollViewer();
     // Set up the display
     Grid.SetColumn(this.infoGrid, 0);
     Grid.SetRow(this.infoGrid, 0);
     this.content.Children.Add(this.infoGrid);
     this.kRegion.Content = this.statesKSV;
     Grid.SetColumn(this.kRegion, 0);
     Grid.SetRow(this.kRegion, 1);
     this.content.Children.Add(this.kRegion);
     // Bind the Kinect sensor
     //var regionSensorBinding = new Binding("Kinect") { Source = SensorChooser };
     this.regionSensorBinding = new Binding("Kinect") { Source = SensorChooser };
     BindingOperations.SetBinding(this.kRegion, KinectRegion.KinectSensorProperty, this.regionSensorBinding);
 }
Пример #2
0
 private KinectTileButton InitializeKinectTileButton(Constants.TimeZones TimeZone)
 {
     KinectTileButton ktb = new KinectTileButton();
     ktb.Name = TimeZone.ToString();
     ktb.Height = this.mainWindow.ActualHeight;
     ktb.Background = new LinearGradientBrush(Color.FromRgb(200, 200, 200), Color.FromRgb(77, 77, 77), 90);
     ktb.Opacity = 0;
     ktb.BorderThickness = new Thickness(0);
     ktb.Padding = new Thickness(0);
     ktb.Margin = new Thickness(0);
     ktb.HorizontalAlignment = HorizontalAlignment.Center;
     ktb.VerticalAlignment = VerticalAlignment.Center;
     // TODO: We also need to add event handlers for the kinect sensor cursor...
     // We only have the mouse events (for debugging) set up currently!
     // Is this called the stylus, etc.?
     ktb.MouseEnter += ButtonMouseEnter;
     ktb.MouseLeave += ButtonMouseLeave;
     ktb.Click += ZoneButtonClick;
     return ktb;
 }
Пример #3
0
 private KinectTileButton CreateNavTileButton(Constants.ViewNames Name, string Content)
 {
     KinectTileButton ktb = new KinectTileButton();
     ktb.Name = Name.ToString();
     if (Name == Constants.ViewNames.TitleScreen)
     {
         ktb.Content = Content;
     }
     else if (Name == Constants.ViewNames.VehicleScreen)
     {
         ktb.Content = "  select\n" + Content;
     }
     else
     {
         ktb.Content = "select\n" + Content;
     }
     ktb.Background = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
     ktb.MaxHeight = this.mainWindow.ActualHeight / 3.75;
     ktb.MaxWidth = this.mainWindow.ActualHeight / 3.75;
     ktb.FontSize = this.mainWindow.ActualHeight / 22;
     ktb.Click += NavButtonClick;
     ktb.HorizontalContentAlignment = HorizontalAlignment.Center;
     ktb.VerticalContentAlignment = VerticalAlignment.Center;
     ktb.HorizontalLabelAlignment = System.Windows.HorizontalAlignment.Center;
     ktb.VerticalLabelAlignment = System.Windows.VerticalAlignment.Center;
     ktb.Foreground = Brushes.White;
     return ktb;
 }