/// <summary> /// Initializes a new instance of the VideoViewModel class /// </summary> public VideoViewModel() : base() { this.playCommand = new RelayCommand(() => { this.CurrentState = State.Playing; }, () => { return this.CanResume || this.CanReplay; }); this.pauseCommand = new RelayCommand(() => { this.CurrentState = State.Paused; }, () => { return this.CanPause; }); this.videoResetNotification = new RelayCommand(() => { this.CurrentState = State.Stopped; }); }
/// <summary> /// Initializes a new instance of the HomeScreenViewModel class that loads model content from the given Uri /// </summary> /// <param name="modelContentUri">Uri to the collection of AttractScreenImage models to be loaded</param> public HomeScreenViewModel(Uri modelContentUri) : base() { this.experienceSelected = new RelayCommand<RoutedEventArgs>(this.OnExperienceSelected); using (Stream experienceModelsStream = Application.GetResourceStream(modelContentUri).Stream) { var experiences = XamlServices.Load(experienceModelsStream) as IList<ExperienceOptionModel>; if (null == experiences) { throw new InvalidDataException(); } this.Experiences = new ObservableCollection<ExperienceOptionModel>(experiences); } }
public KinectController() { this.QueryPrimaryUserCallback = this.OnQueryPrimaryUserCallback; this.PreEngagementUserColors = new Dictionary<int, Color>(); this.PostEngagementUserColors = new Dictionary<int, Color>(); this.engagementStateManager.TrackedUsersChanged += this.OnEngagementManagerTrackedUsersChanged; this.engagementStateManager.CandidateUserChanged += this.OnEngagementManagerCandidateUserChanged; this.engagementStateManager.EngagedUserChanged += this.OnEngagementManagerEngagedUserChanged; this.engagementStateManager.PrimaryUserChanged += this.OnEngagementManagerPrimaryUserChanged; this.handoffConfirmationStasisTimer.Tick += this.OnHandoffConfirmationStasisTimerTick; this.disengagementNavigationTimer.Tick += this.OnDisengagementNavigationTick; this.shutdownCommand = new RelayCommand(this.Cleanup); this.engagementConfirmationCommand = new RelayCommand<RoutedEventArgs>(this.OnEngagementConfirmation); this.engagementHandoffConfirmationCommand = new RelayCommand<RoutedEventArgs>(this.OnEngagementHandoffConfirmation); this.sensorChooser.KinectChanged += this.SensorChooserOnKinectChanged; this.sensorChooser.Start(); }
public NavigationManager() : base() { this.navigateBackCommand = new RelayCommand(GoBack, () => { return this.CanGoBack; }); }
public ResultScreenViewModel() { restartCommand = new RelayCommand(Restart); backCommand = new RelayCommand(GoBack); }
/// <summary> /// Initializes a new instance of the AttractScreenViewModel class that loads model content from the given Uri /// </summary> /// <param name="modelContentUri">Uri to the collection of AttractScreenImage models to be loaded</param> public QuestionScreenViewModel() : base() { this.LoadFiles(); RightScrollLen = (SystemParameters.FullPrimaryScreenWidth) * ((960 - 196) / 960.0) * 0.5; LeftScrollLen = -RightScrollLen+6; LeftMaskLen = SystemParameters.FullPrimaryScreenWidth / 2; LeftMaskEnd = LeftMaskLen + LeftScrollLen; ScrollHeight = (585.0 / 766.0) * RightScrollLen; CurrentChoices = new ObservableCollection<KinectTileButton>(); CurrentChoicesLayout2 = new ObservableCollection<KinectTileButton>(); currentIndex = 0; CurrentQuestionGroup=new List<QuestionModel>(); ResizeRatio = RightScrollLen / 766; const string rightContentPath = "/Content/QuestionScreen/rightContent.png"; RightContentImage = ImageHelper.ChangeSize(rightContentPath, (int)RightScrollLen, (int)ScrollHeight, ImageHelper.AdjustMode.W); const string leftMaskPath = "/Content/QuestionScreen/leftBg.png"; LeftMaskImage = ImageHelper.ChangeSize(leftMaskPath,ResizeRatio,ImageHelper.AdjustMode.W); const string downContentPath = "/Content/QuestionScreen/downContent.png"; DownContentImage = ImageHelper.ChangeSize(downContentPath, ResizeRatio, ImageHelper.AdjustMode.W); ButtonWidth = 460.0*ResizeRatio; BrushWidth = 147*ResizeRatio; BrushHeight = 345*ResizeRatio; BrushMoveX = -236*ResizeRatio; BrushMoveY = -297*ResizeRatio; NextButtonWidth = 366*ResizeRatio; NextButtonHeight = 240*ResizeRatio; DownScrollWidth = 598*ResizeRatio; DownScrollLen = 900*ResizeRatio; DownContentLen = DownScrollLen + 65*ResizeRatio; DownButtonWidth = 460*ResizeRatio; DownButtonHeight = 214*ResizeRatio; DownContentHeight = 261*ResizeRatio; this.nextCommand = new RelayCommand(this.SwitchQuestion); this.backCommand = new RelayCommand(()=> this.NavigationManager.NavigateToHome(DefaultNavigableContexts.AttractScreen2)); }
public KinectController() { this.QueryPrimaryUserCallback = this.OnQueryPrimaryUserCallback; this.PreEngagementUserColors = new Dictionary<int, Color>(); this.PostEngagementUserColors = new Dictionary<int, Color>(); this.engagementStateManager.TrackedUsersChanged += this.OnEngagementManagerTrackedUsersChanged; this.engagementStateManager.CandidateUserChanged += this.OnEngagementManagerCandidateUserChanged; this.engagementStateManager.EngagedUserChanged += this.OnEngagementManagerEngagedUserChanged; this.engagementStateManager.PrimaryUserChanged += this.OnEngagementManagerPrimaryUserChanged; this.handoffConfirmationStasisTimer.Tick += this.OnHandoffConfirmationStasisTimerTick; this.disengagementNavigationTimer.Tick += this.OnDisengagementNavigationTick; this.shutdownCommand = new RelayCommand(this.Cleanup); this.engagementConfirmationCommand = new RelayCommand<RoutedEventArgs>(this.OnEngagementConfirmation); this.engagementHandoffConfirmationCommand = new RelayCommand<RoutedEventArgs>(this.OnEngagementHandoffConfirmation); this.sensorChooser.KinectChanged += this.SensorChooserOnKinectChanged; this.sensorChooser.Start(); double logoRatio = (SystemParameters.FullPrimaryScreenHeight) / 1920; LogoSize = (new Size(logoRatio * originLogoSize.Width, logoRatio * originLogoSize.Height)); //todo change here to fix the start up position of the logo //LogoPosition = new Point(SystemParameters.PrimaryScreenWidth / 2, SystemParameters.FullPrimaryScreenHeight * defaultLogoY); LogoPosY = SystemParameters.FullPrimaryScreenHeight/4; UpLen = (SystemParameters.FullPrimaryScreenHeight/4)*0.65; AlertMessage = "Enjoy Life";//change here to change the message when program starting timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(500); timer.Tick += (a, b) => { if (NavigationManager.CurrentNavigationContext is AttractScreen2ViewModel && LogoVisibility == Visibility.Collapsed) { LogoVisibility = Visibility.Visible; this.engagementStateManager.Reset(); //SensorChooserOnKinectChanged(this,new KinectChangedEventArgs(KinectSensorChooser.Kinect,KinectSensorChooser.Kinect)); } }; timer.Start(); }
PuzzleViewModel() { Title = "Puzzle"; ButtonClicked = new RelayCommand(this.OnButtonClicked); }