/// <summary> /// 隐藏掉初始界面,打开第二个二级界面 /// </summary> private void ShowCategorySelection2() { var animateOpacity = new DoubleAnimation(1, 0, TimeSpan.FromMilliseconds(500)); animateOpacity.Completed += (o, e) => { var mainWin = Application.Current.MainWindow as MainWindow; mainWin.ShowCategorySelection2(); this.Visibility = Visibility.Collapsed; }; this.BeginAnimation(Introduction.OpacityProperty, animateOpacity); KinectController.RemoveHandRaisedHandler(this, new EventHandler <HandInputEventArgs>(this.OnHandRaised)); }
internal void FadeIn() { var animateOpacity = new DoubleAnimation(0, 1, TimeSpan.FromMilliseconds(500)); animateOpacity.Completed += (o, e) => { var mainWin = Application.Current.MainWindow as MainWindow; mainWin.VUI.AnimateMicIntro(); KinectController.AddHandRaisedHandler(this, new EventHandler <HandInputEventArgs>(OnHandRaised)); ((MainWindow)Application.Current.MainWindow).SetVoiceInstruction(Settings.Default.StartVui, Settings.Default.VuiDisplayDelay); }; this.Visibility = Visibility.Visible; this.BeginAnimation(Introduction.OpacityProperty, animateOpacity); }
/// <summary> /// 隐藏掉吸引界面,出现这个介绍界面,而且是以动画的形式渐入 /// </summary> internal void FadeIn() { var animateOpacity = new DoubleAnimation(0, 1, TimeSpan.FromMilliseconds(500)); animateOpacity.Completed += (o, e) => { var mainWin = Application.Current.MainWindow as MainWindow; KinectController.AddHandRaisedHandler(this, new EventHandler <HandInputEventArgs>(OnHandRaised)); }; this.Visibility = Visibility.Visible; Storyboard storyboard = (Storyboard)this.FindResource("onGoing"); storyboard.Begin(this); this.BeginAnimation(Introduction.OpacityProperty, animateOpacity); }
protected virtual void Dispose(bool disposing) { if (disposing) { if (this.soundPlayerOnEnter != null) { this.soundPlayerOnEnter.Dispose(); this.soundPlayerOnEnter = null; } if (this.soundPlayerOnClick != null) { this.soundPlayerOnClick.Dispose(); this.soundPlayerOnClick = null; } KinectController.RemovePreviewHandEnterHandler(this, this.OnPreviewHandEnter); KinectController.RemovePreviewHandLeaveHandler(this, this.OnPreviewHandLeave); } }
/// <summary> /// 在构造函数中设置好计时器的各项属性,并添加上下滚动的交互区域(UpScrollRegion DownScrollRegion),调用相应的方法. /// </summary> public StorySelectionControl() { this.InitializeComponent(); if (Settings.Default.ShowScrollRegions) { this.scrollTimer = new DispatcherTimer(); double scrollingTick = 100 - Settings.Default.ScrollSpeed; this.scrollTimer.Interval = TimeSpan.FromMilliseconds(scrollingTick); this.scrollTimer.Tick += this.ScrollTimer_Tick; KinectController.AddPreviewHandEnterHandler(this.UpScrollRegion, this.OnPreviewHandEnterUp); KinectController.AddPreviewHandLeaveHandler(this.UpScrollRegion, this.OnPreviewHandLeaveUp); KinectController.AddPreviewHandEnterHandler(this.DownScrollRegion, this.OnPreviewHandEnterDown); KinectController.AddPreviewHandLeaveHandler(this.DownScrollRegion, this.OnPreviewHandLeaveDown); ContentScrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden; this.ContentScrollViewer.ScrollChanged += new ScrollChangedEventHandler(this.ContentScrollViewer_ScrollChanged); } else { } }
public StorySelectionControl() { this.InitializeComponent(); if (Settings.Default.ShowScrollRegions) { this.scrollTimer = new DispatcherTimer(); double scrollingTick = 100 - Settings.Default.ScrollSpeed; this.scrollTimer.Interval = TimeSpan.FromMilliseconds(scrollingTick); this.scrollTimer.Tick += this.ScrollTimer_Tick; KinectController.AddPreviewHandEnterHandler(this.LeftScrollRegion, this.OnPreviewHandEnterLeft); KinectController.AddPreviewHandLeaveHandler(this.LeftScrollRegion, this.OnPreviewHandLeaveLeft); KinectController.AddPreviewHandEnterHandler(this.RightScrollRegion, this.OnPreviewHandEnterRight); KinectController.AddPreviewHandLeaveHandler(this.RightScrollRegion, this.OnPreviewHandLeaveRight); ContentScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden; this.ContentScrollViewer.ScrollChanged += new ScrollChangedEventHandler(this.ContentScrollViewer_ScrollChanged); } else { this.MainGrid.Children.Remove(this.LeftScrollRegion); this.MainGrid.Children.Remove(this.RightScrollRegion); } }
private void OnHandRaised(object sender, HandInputEventArgs args) { this.IsHandRaised = true; KinectController.RemoveHandRaisedHandler(this, this.OnHandRaised); }
public HoverDwellButton() { KinectController.AddPreviewHandEnterHandler(this, this.OnPreviewHandEnter); KinectController.AddPreviewHandLeaveHandler(this, this.OnPreviewHandLeave); }