private void SetElementVisiable(ImageItem oItem) { if (oItem == null) { return; } if (!oItem.IsVisible) { if (!this.CvMain.Children.Contains(oItem)) { oItem.IsVisible = true; this.CvMain.Children.Add(oItem); } } this.DoUpdateElementLocation(oItem); }
private void Carousel2DView_MouseMove(object sender, MouseEventArgs e) { if (this.IsMouseDown) { this.CurrentX = e.GetPosition(this).X; this.IntervalDegree = this.CurrentX - this.PreviousX; this.TotalMoveDegree += Math.Abs(this.IntervalDegree * 0.5d); this.InertiaDegree = this.IntervalDegree * 5d; for (int i = 0; i < this.ElementList.Count; i++) { ImageItem oItem = this.ElementList[i]; oItem.Degree += this.IntervalDegree; } this.UpdateLocation(); this.PreviousX = this.CurrentX; } }
private void CreateElements() { double dAverageDegree = 360d / VisualCount; this.TotalDegree = this.FileItems.Count * dAverageDegree; this.ElementList = new List <ImageItem>(); for (int i = 0; i < this.FileItems.Count; i++) { ImageItem oItem = new ImageItem(FileItems[i]); oItem.MouseLeftButtonDown += OItem_MouseLeftButtonDown; oItem.MouseLeftButtonUp += OItem_MouseLeftButtonUp; oItem.Width = this.ElementWidth; oItem.Height = this.ElementHeight; oItem.Y = 0d; oItem.Degree = i * dAverageDegree; this.ElementList.Add(oItem); } this.UpdateLocation(); }
private void OItem_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { CurNavItem = sender as ImageItem; }