Ejemplo n.º 1
0
        protected void LayoutChild(CoverFlowItem item, int index)
        {
            double m = ItemsPresenter.ActualWidth / 2;

            int b = index - SelectedIndex;
            double mu = 0;
            if (b < 0)
                mu = -1;
            else if (b > 0)
                mu = 1;
            double x = (m + ((double)b * l + (k * mu))) - (item.ActualWidth / 2);

            double s = mu == 0 ? 1 : Scale;

            int zindex = items.Count - Math.Abs(b);

            if (((x + item.ActualWidth) < 0 || x > ItemsPresenter.ActualWidth)
                && ((item.X + item.ActualWidth) < 0 || item.X > ItemsPresenter.ActualWidth)
                && !((x + item.ActualWidth) < 0 && item.X > ItemsPresenter.ActualWidth)
                && !((item.X + item.ActualWidth) < 0 && x > ItemsPresenter.ActualWidth))
            {
                item.SetValues(x, zindex, r * mu, z * Math.Abs(mu), s, duration, EasingFunction, false);
            }
            else
            {
                item.SetValues(x, zindex, r * mu, z * Math.Abs(mu), s, duration, EasingFunction, true);
            }
        }
Ejemplo n.º 2
0
 protected override DependencyObject GetContainerForItemOverride()
 {
     CoverFlowItem item = new CoverFlowItem();
     return item;
 }