private void InitEventHandler() { this.MouseDown += (sender, e) => { if (isInAnime) { return; } if (e.GetPosition(this).X > 500) { if (StartIndex < PictureInfoList.Count - 1) { isInAnime = true; STB_SwitchLeft.Begin(); } } else if (e.GetPosition(this).X < 300) { if (StartIndex > 0) { isInAnime = true; STB_SwitchRight.Begin(); } } }; for (int i = 0; i < controlList.Count; i++) { controlList[i].MouseDown += delegate(object sender, MouseButtonEventArgs e) { int indexs = controlList.IndexOf(sender as Control); if (indexs != -1 && ImageButtonClicked != null) { ImageButtonClicked(sender, pictureInfoList[StartIndex], pictureInfoList); } }; } STB_SwitchLeft.Completed += new EventHandler(STB_SwitchLeft_Completed); STB_SwitchRight.Completed += new EventHandler(STB_SwitchRight_Completed); App.ViewModel.LoadDetailsProgressChanged += (vi) => { RefreshControlBackground(vi); }; App.ViewModel.DetailWorkCompleted += () => { this.Visibility = Visibility.Collapsed; this.Visibility = Visibility.Visible; }; }
private void MyCoverFlow_MouseDown(object sender, MouseButtonEventArgs e) { if (isInAnime) { return; } if (e.GetPosition(this).X > 500) { if (StartIndex < VideoInfoList.Count - 1) { isInAnime = true; STB_SwitchLeft.Begin(); } } else if (e.GetPosition(this).X < 300) { if (StartIndex > 0) { isInAnime = true; STB_SwitchRight.Begin(); } } }