public void NewUser(UserState state) { Dispatcher.CurrentDispatcher.BeginInvoke((Action)(()=> welcomeTickerTimer.Stop())); if(!welcomeTickerTimer.IsEnabled) BuildWelcomeMessages(); if (NewHelpMessage != null) NewHelpMessage(this, new HelpMessageEventArgs() { Message = "Welcome!" }); Dispatcher.CurrentDispatcher.BeginInvoke((Action)(()=>welcomeTickerTimer.Start())); }
public void UserStateUpdated(UserState state) { if (!wasOutOfBounds && state.OutOfBounds) { wasOutOfBounds = true; SendHelp("To continue movement, pull your hand back and recenter it on the screen",""); } if (!state.OutOfBounds) wasOutOfBounds = false; }
public ViewModel(IKinectService kinectService, ISourceService sourceService, IBoardService boardService, IHelpService helpService) { user = new UserState(); idleJobQueue = new Queue<Action>(); this.helpService = helpService; this.helpService.NewHelpMessage += new EventHandler<HelpMessageEventArgs>(helpService_NewHelpMessage); this.kinectService = kinectService; this.sourceService = sourceService; this.sourceService.EventsUpdated += new EventHandler<SourceEventArgs>(sourceService_EventsUpdated); this.boardService = boardService; this.boardService.BoardsUpdated += new EventHandler(boardService_BoardsChanged); appIdleTimer = new DispatcherTimer(); appIdleTimer.Interval = TimeSpan.FromMinutes(1); appIdleTimer.Tick += new EventHandler(appIdle_Tick); appIdleTimer.Start(); }