예제 #1
0
        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);
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
        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();
        }
예제 #4
0
 private void OItem_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     CurNavItem = sender as ImageItem;
 }