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();
        }
Exemple #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;
        }
Exemple #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;
 }
        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;
            }
        }
Exemple #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());
            }
        }
Exemple #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();
        }
        private static void OnFrontItemGapChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ElementFlow ef = d as ElementFlow;

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

            cf.ReflowItems();
        }
Exemple #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;
 }
 internal void SetOwner(ElementFlow owner)
 {
     Owner = owner;
 }
Exemple #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;
        }
Exemple #16
0
 protected virtual Storyboard PrepareItemAnimation(ElementFlow owner, int index, ElementFlow.ElementAnimationType type)
 {
     return(null);
 }