Exemplo n.º 1
0
        private static void OnViewModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ElementFlow ef = d as ElementFlow;

            ef.ChangeViewState((ViewModeType)e.NewValue);
            ef.ReflowItems();
        }
        private static void OnPopoutDistanceChanged(DependencyObject d,
                                                    DependencyPropertyChangedEventArgs e)
        {
            ElementFlow ef = d as ElementFlow;

            ef.ReflowItems();
        }
Exemplo n.º 3
0
        protected override Storyboard PrepareItemAnimation(ElementFlow owner, int index, ElementFlow.ElementAnimationType type)
        {
            // Initialize storyboard
            Storyboard sb = owner.PrepareTemplateStoryboard(index);

            // Child animations
            Rotation3DAnimation rotAnim = sb.Children[0] as Rotation3DAnimation;
            DoubleAnimation     xAnim   = sb.Children[1] as DoubleAnimation;
            DoubleAnimation     yAnim   = sb.Children[2] as DoubleAnimation;
            DoubleAnimation     zAnim   = sb.Children[3] as DoubleAnimation;

            switch (type)
            {
            case ElementFlow.ElementAnimationType.Left:
                (rotAnim.To as AxisAngleRotation3D).Angle = owner.TiltAngle;
                (rotAnim.To as AxisAngleRotation3D).Axis  = new Vector3D(1, 0, 0);
                yAnim.To = -1 * owner.ItemGap * (owner.SelectedIndex - index) - owner.FrontItemGap;
                break;

            case ElementFlow.ElementAnimationType.Right:
                (rotAnim.To as AxisAngleRotation3D).Angle = -1 * owner.TiltAngle;
                (rotAnim.To as AxisAngleRotation3D).Axis  = new Vector3D(1, 0, 0);
                yAnim.To = owner.ItemGap * (index - owner.SelectedIndex) + owner.FrontItemGap;
                break;

            case ElementFlow.ElementAnimationType.Selection:
                (rotAnim.To as AxisAngleRotation3D).Angle = 0;
                yAnim.To = 0;
                zAnim.To = owner.PopoutDistance;
                break;
            }

            return(sb);
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this._tiltAngleSlider = ((System.Windows.Controls.Slider)(target));
                return;

            case 2:
                this._itemGapSlider = ((System.Windows.Controls.Slider)(target));
                return;

            case 3:
                this._frontItemGapSlider = ((System.Windows.Controls.Slider)(target));
                return;

            case 4:
                this._popoutDistanceSlider = ((System.Windows.Controls.Slider)(target));
                return;

            case 5:
                this._elementFlow = ((FluidKit.Controls.ElementFlow)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 5
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
 {
     switch (connectionId)
     {
     case 1:
         this._elementFlow = ((FluidKit.Controls.ElementFlow)(target));
         return;
     }
     this._contentLoaded = true;
 }
Exemplo n.º 6
0
        private static void OnSelectedIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ElementFlow ef = d as ElementFlow;

            if (ef.IsLoaded == false)
            {
                return;
            }

            ef.SelectItemCore((int)e.NewValue);
        }
        private static void OnCameraChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ElementFlow ef = d as ElementFlow;

            PerspectiveCamera camera = e.NewValue as PerspectiveCamera;

            if (camera == null)
            {
                throw new ArgumentNullException("e", "The Camera cannot be null");
            }

            if (ef.IsLoaded)
            {
                ef.Viewport.Camera = camera;
            }
        }
Exemplo n.º 8
0
        private static void OnSelectedIndexChanged(DependencyObject d,
                                                   DependencyPropertyChangedEventArgs e)
        {
            ElementFlow ef = d as ElementFlow;

            if (ef.IsLoaded == false)
            {
                return;
            }

            int oldIndex = (int)e.OldValue;
            int newIndex = (int)e.NewValue;

            ef.SelectItemCore(newIndex);
            if (oldIndex != newIndex && ef.SelectedIndexChanged != null)
            {
                ef.SelectedIndexChanged(ef, new EventArgs());
            }
        }
Exemplo n.º 9
0
        public void SelectElement(ElementFlow owner, int index)
        {
            Storyboard anim;

            for (int leftItem = 0; leftItem < index; leftItem++)
            {
                anim = PrepareItemAnimation(owner, leftItem, ElementFlow.ElementAnimationType.Left);
                owner.AnimateElement(anim);
            }

            anim = PrepareItemAnimation(owner, index, ElementFlow.ElementAnimationType.Selection);
            owner.AnimateElement(anim);

            for (int rightItem = index + 1; rightItem < owner.VisibleChildrenCount; rightItem++)
            {
                anim = PrepareItemAnimation(owner, rightItem, ElementFlow.ElementAnimationType.Right);
                owner.AnimateElement(anim);
            }
        }
        private static void OnLayoutChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ElementFlow ef      = d as ElementFlow;
            var         oldView = e.OldValue as LayoutBase;

            if (oldView != null)
            {
                oldView.Owner = null;
            }

            LayoutBase newView = e.NewValue as LayoutBase;

            if (newView == null)
            {
                throw new ArgumentNullException("e", "The Layout cannot be null");
            }

            newView.Owner = ef;
            ef.ReflowItems();
        }
Exemplo n.º 11
0
        private static void OnFrontItemGapChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ElementFlow ef = d as ElementFlow;

            ef.ReflowItems();
        }
Exemplo n.º 12
0
        private static void OnTiltAngleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ElementFlow cf = d as ElementFlow;

            cf.ReflowItems();
        }
Exemplo n.º 13
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.UserControl = ((Kinect.Joy.View3D)(target));
     return;
     case 2:
     this.EFlow = ((FluidKit.Controls.ElementFlow)(target));
     return;
     }
     this._contentLoaded = true;
 }
Exemplo n.º 14
0
 internal void SetOwner(ElementFlow owner)
 {
     Owner = owner;
 }
Exemplo n.º 15
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this._selectedIndexSlider = ((System.Windows.Controls.Slider)(target));

            #line 95 "..\..\..\ElementFlow\ElementFlowExample.xaml"
                this._selectedIndexSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.ChangeSelectedIndex);

            #line default
            #line hidden
                return;

            case 2:
                this._tiltAngleSlider = ((System.Windows.Controls.Slider)(target));
                return;

            case 3:
                this._itemGapSlider = ((System.Windows.Controls.Slider)(target));
                return;

            case 4:
                this._frontItemGapSlider = ((System.Windows.Controls.Slider)(target));
                return;

            case 5:
                this._popoutDistanceSlider = ((System.Windows.Controls.Slider)(target));
                return;

            case 6:
                this._regular = ((System.Windows.Controls.Button)(target));

            #line 125 "..\..\..\ElementFlow\ElementFlowExample.xaml"
                this._regular.Click += new System.Windows.RoutedEventHandler(this.AddCard);

            #line default
            #line hidden
                return;

            case 7:
                this._alert = ((System.Windows.Controls.Button)(target));

            #line 129 "..\..\..\ElementFlow\ElementFlowExample.xaml"
                this._alert.Click += new System.Windows.RoutedEventHandler(this.AddCard);

            #line default
            #line hidden
                return;

            case 8:

            #line 132 "..\..\..\ElementFlow\ElementFlowExample.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.RemoveCard);

            #line default
            #line hidden
                return;

            case 9:
                this._elementFlow = ((FluidKit.Controls.ElementFlow)(target));
                return;

            case 10:
                this._currentViewText = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 16
0
 protected virtual Storyboard PrepareItemAnimation(ElementFlow owner, int index, ElementFlow.ElementAnimationType type)
 {
     return(null);
 }