Пример #1
0
        private void MetroLink_Click(object sender, EventArgs e)
        {
            ExpandAnimation animation = new ExpandAnimation();

            animation.AnimationCompleted += Animation_AnimationCompleted;
            switch (collapseDirection)
            {
            case CollapseDirectionStyle.Width:
                if (MaximumSize.Width > Width)
                {
                    animation.Start(this, MaximumSize, TransitionType.Linear, 20);
                }
                else
                {
                    animation.Start(this, MinimumSize, TransitionType.Linear, 20);
                }
                break;

            case CollapseDirectionStyle.Height:
                if (Height > MinimumSize.Height)
                {
                    animation.Start(this, MinimumSize, TransitionType.Linear, 20);
                }
                else
                {
                    animation.Start(this, MaximumSize, TransitionType.Linear, 20);
                }
                break;
            }
        }
Пример #2
0
 public XmlTreeView(RadTreeView treeView)
 {
     this.AllowDragDrop            = treeView.AllowDragDrop;
     this.AllowDrop                = treeView.AllowDrop;
     this.BackColor                = treeView.BackColor;
     this.CheckBoxes               = treeView.CheckBoxes;
     this.MultiSelect              = treeView.MultiSelect;
     this.FullRowSelect            = treeView.FullRowSelect;
     this.ItemHeight               = treeView.ItemHeight;
     this.LineColor                = treeView.LineColor;
     this.LineStyle                = treeView.LineStyle;
     this.PathSeparator            = treeView.PathSeparator;
     this.ShowLines                = treeView.ShowLines;
     this.ShowExpandCollapse       = treeView.ShowExpandCollapse;
     this.ShowRootLines            = treeView.ShowRootLines;
     this.ThemeClassName           = treeView.ThemeClassName;
     this.ThemeName                = treeView.ThemeName;
     this.TreeIndent               = treeView.TreeIndent;
     this.TriStateMode             = treeView.TriStateMode;
     this.LabelEdit                = treeView.AllowEdit;
     this.ExpandAnimation          = treeView.ExpandAnimation;
     this.AllowArbitraryItemHeight = treeView.AllowArbitraryItemHeight;
     this.AllowDragDrop            = treeView.AllowDragDrop;
     this.SpacingBetweenNodes      = treeView.SpacingBetweenNodes;
     this.RightToLeft              = treeView.RightToLeft;
     this.SpacingBetweenNodes      = treeView.SpacingBetweenNodes;
     foreach (RadTreeNode node in (Collection <RadTreeNode>)treeView.Nodes)
     {
         this.Nodes.Add(new XmlTreeNode(node));
     }
 }
Пример #3
0
 public XmlDataFilter(RadDataFilter dataFilter)
 {
     this.Expression = dataFilter.Expression;
     this.AutoGenerateDescriptorItems = dataFilter.AutoGenerateDescriptorItems;
     this.SortFieldNames           = dataFilter.SortFieldNames;
     this.AllowAdd                 = dataFilter.AllowAdd;
     this.AllowRemove              = dataFilter.AllowRemove;
     this.AllowDragDrop            = dataFilter.AllowDragDrop;
     this.AllowDrop                = dataFilter.AllowDrop;
     this.BackColor                = dataFilter.BackColor;
     this.CheckBoxes               = dataFilter.CheckBoxes;
     this.MultiSelect              = dataFilter.MultiSelect;
     this.ItemHeight               = dataFilter.ItemHeight;
     this.LineColor                = dataFilter.LineColor;
     this.LineStyle                = dataFilter.LineStyle;
     this.PathSeparator            = dataFilter.PathSeparator;
     this.ShowLines                = dataFilter.ShowLines;
     this.ShowExpandCollapse       = dataFilter.ShowExpandCollapse;
     this.ShowRootLines            = dataFilter.ShowRootLines;
     this.ThemeClassName           = dataFilter.ThemeClassName;
     this.ThemeName                = dataFilter.ThemeName;
     this.TreeIndent               = dataFilter.TreeIndent;
     this.LabelEdit                = dataFilter.AllowEdit;
     this.ExpandAnimation          = dataFilter.ExpandAnimation;
     this.AllowArbitraryItemHeight = dataFilter.AllowArbitraryItemHeight;
     this.SpacingBetweenNodes      = dataFilter.SpacingBetweenNodes;
     this.RightToLeft              = dataFilter.RightToLeft;
 }
 private void SumAvg_checkedChanged(object sender, EventArgs e)
 {
     if (sum_avg != null && sum_avg.Count > 0)
     {
         ExpandAnimation ea  = new ExpandAnimation();
         ExpandAnimation ea2 = new ExpandAnimation();
         //Afficher ou chacher les listesBox
         sum_list.Visible = sum_cb.Checked;
         avg_list.Visible = avg_cb.Checked;
         //Reglage de l'animation
         if (!sum_cb.Checked && !avg_cb.Checked)
         {//Reduire
             ea.Start(footer_panel, new Size(832, 53), TransitionType.EaseInExpo, 15);
             ea2.Start(this, new Size(835, 520), TransitionType.EaseInExpo, 10);
         }
         else
         {
             ea.Start(footer_panel, new Size(832, 126), TransitionType.EaseInExpo, 15);
             ea2.Start(this, new Size(835, 592), TransitionType.EaseInExpo, 10);
         }
     }
     else
     {
         //Unsubscribe Event
         sum_cb.CheckedChanged -= SumAvg_checkedChanged;
         avg_cb.CheckedChanged -= SumAvg_checkedChanged;
         //uncheck controls
         sum_cb.Checked = avg_cb.Checked = false;
         //Subscribe Event
         sum_cb.CheckedChanged += SumAvg_checkedChanged;
         avg_cb.CheckedChanged += SumAvg_checkedChanged;
         MessageBox.Show("Aucun Champs Numeric Dans Votre Resultat pour effectuer cette tache !");
     }
 }
Пример #5
0
        private void getMemberListLable_Click(object sender, EventArgs e)
        {
            memberListPanel.Location = new Point(490, 75);
            ExpandAnimation en = new ExpandAnimation();

            en.Start(memberListPanel, new Size(580, 303), TransitionType.Linear, 20);
        }
Пример #6
0
        private void removeMemberLable_Click(object sender, EventArgs e)
        {
            searchPanel.Location = new Point(448, 287);
            ExpandAnimation en = new ExpandAnimation();

            en.Start(searchPanel, new Size(239, 72), TransitionType.Linear, 20);
        }
Пример #7
0
        private void ModuleBtn_Click(object sender, EventArgs e)
        {
            var ex = new ExpandAnimation();

            if (Height == _panelHeight)
            {
                ex.Start(this, new Size(Width, 24), TransitionType.Linear, 7);
            }
            else
            {
                ex.Start(this, new Size(Width, _panelHeight), TransitionType.Linear, 7);
            }
        }
Пример #8
0
        private void Expand_PointerPressed(object sender, PointerRoutedEventArgs e)
        {
            if (PlayArea.Height == DefaultHeight)
            {
                ExpandAnimation.Begin();
                BorderExpandAnimation.Begin();
                Expand.Glyph = "\uE70D";
                ToolTipService.SetToolTip(Expand, "缩小");
                Shrink.Visibility    = Visibility.Collapsed;
                LyricArea.Visibility = Visibility.Visible;
                BackImage.Visibility = Visibility.Visible;
                Acrylic.Visibility   = Visibility.Visible;

                RelativePanel.SetRightOf(SongPLayingName, null);
                RelativePanel.SetAlignLeftWith(SongPLayingSingerName, null);
                RelativePanel.SetBelow(SongPLayingName, AlbumCover);
                RelativePanel.SetAlignHorizontalCenterWith(SongPLayingName, AlbumCover);
                RelativePanel.SetAlignHorizontalCenterWith(SongPLayingSingerName, AlbumCover);
                RelativePanel.SetAlignLeftWith(PlayProcess, AlbumCover);
            }
            else if (PlayArea.Height > DefaultHeight)
            {
                ShrinkBackAnimation.Begin();
                BorderShrinkAnimation.Begin();
                Expand.Glyph = "\uE70E";
                ToolTipService.SetToolTip(Expand, "伸展");
                Shrink.Visibility    = Visibility.Visible;
                LyricArea.Visibility = Visibility.Collapsed;
                BackImage.Visibility = Visibility.Collapsed;
                Acrylic.Visibility   = Visibility.Collapsed;

                RelativePanel.SetBelow(SongPLayingName, null);
                RelativePanel.SetAlignHorizontalCenterWith(SongPLayingName, null);
                RelativePanel.SetAlignHorizontalCenterWith(SongPLayingSingerName, null);
                RelativePanel.SetBelow(SongPLayingName, null);

                RelativePanel.SetAlignLeftWith(SongPLayingSingerName, SongPLayingName);
                RelativePanel.SetAlignLeftWith(PlayProcess, SongPLayingName);
                RelativePanel.SetRightOf(SongPLayingName, AlbumCover);
            }
            else if (PlayArea.Height < DefaultHeight)
            {
                expandplayarea();
            }
        }
Пример #9
0
        private void StackPanel_Tapped(object sender, TappedRoutedEventArgs e)
        {
            if (ViewModel.DetailsVisible == Visibility.Collapsed)
            {
                ExpandAnimation.Begin();
                ViewModel.DetailsVisible = Visibility.Visible;

                DetailsIcon.Translation  = new Vector3(0f, 12f, 0f);
                DetailsIcon.Rotation     = 180;
                DetailsIcon.RotationAxis = new Vector3(1f, 0f, 0f);
            }
            else
            {
                ViewModel.DetailsVisible = Visibility.Collapsed;
                CompressAnimation.Begin();

                DetailsIcon.Translation = new Vector3(0f, 0f, 0f);
                DetailsIcon.Rotation    = 0;
            }
        }
Пример #10
0
        public void ChangeStatus(int width)
        {
            ExpandAnimation animation = new ExpandAnimation();

            animation.AnimationCompleted += Animation_AnimationCompleted;
            switch (Status)
            {
            case MetroAddonPanelStatus.Open:
                if (Pinned)
                {
                    break;
                }
                animation.Start(this, new Size(0, Height), TransitionType.Linear, 20);
                break;

            case MetroAddonPanelStatus.Close:
                BringToFront();
                Visible = true;
                animation.Start(this, new Size(width, Height), TransitionType.Linear, 20);
                break;
            }
        }
Пример #11
0
        private void reset()
        {
            if (searchPanel.Size.Width > 0)
            {
                ExpandAnimation en = new ExpandAnimation();
                en.Start(searchPanel, new Size(0, 72), TransitionType.EaseOutQuad, 20);
            }
            else if (searchPanel.Size.Width == 0)
            {
                if (activePanel != null)
                {
                    ExpandAnimation en = new ExpandAnimation();
                    en.Start(activePanel, new Size(0, 0), TransitionType.EaseOutQuad, 20);
                }
            }



            activePanel  = null;
            activeLable  = null;
            activePicBox = null;
        }
Пример #12
0
 private void SearchBox_OnPointerEntered(object sender, PointerRoutedEventArgs e)
 {
     ExpandAnimation.Begin();
 }
Пример #13
0
            public override View GetChildView(int groupPosition, int childPosition, bool isLastChild, View convertView, ViewGroup parent)
            {
                GroupInfo info = GetGroupInfo(groupPosition);

                if (info.animating)
                {
                    // If this group is animating, return the a DummyView...
                    if (convertView is DummyView == false)
                    {
                        convertView = new DummyView(parent.Context);
                        convertView.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, 0);
                    }

                    if (childPosition < info.firstChildPosition)
                    {
                        convertView.LayoutParameters.Height = 0;
                        return(convertView);
                    }

                    ExpandableListView listView  = (ExpandableListView)parent;
                    DummyView          dummyView = (DummyView)convertView;

                    // Clear the views that the dummy view draws.
                    dummyView.ClearViews();

                    // Set the style of the divider
                    dummyView.SetDivider(listView.Divider, parent.MeasuredWidth, listView.DividerHeight);

                    // Make measure specs to measure child views
                    int measureSpecW = MeasureSpec.MakeMeasureSpec(parent.Width, MeasureSpecMode.Exactly);
                    int measureSpecH = MeasureSpec.MakeMeasureSpec(0, MeasureSpecMode.Unspecified);

                    int totalHeight = 0;
                    int clipHeight  = parent.Height;

                    int len = GetRealChildrenCount(groupPosition);
                    for (int i = info.firstChildPosition; i < len; i++)
                    {
                        View childView = GetRealChildView(groupPosition, i, (i == len - 1), null, parent);

                        LayoutParams p = (LayoutParams)childView.LayoutParameters;
                        if (p == null)
                        {
                            p = (LayoutParams)GenerateDefaultLayoutParams();
                            childView.LayoutParameters = p;
                        }

                        int lpHeight = p.Height;

                        int childHeightSpec;
                        if (lpHeight > 0)
                        {
                            childHeightSpec = MeasureSpec.MakeMeasureSpec(lpHeight, MeasureSpecMode.Exactly);
                        }
                        else
                        {
                            childHeightSpec = measureSpecH;
                        }

                        childView.Measure(measureSpecW, childHeightSpec);
                        totalHeight += childView.MeasuredHeight;

                        if (totalHeight < clipHeight)
                        {
                            // we only need to draw enough views to fool the user...
                            dummyView.AddFakeView(childView);
                        }
                        else
                        {
                            dummyView.AddFakeView(childView);

                            // if this group has too many views, we don't want to
                            // calculate the height of everything... just do a light
                            // approximation and break
                            int averageHeight = totalHeight / (i + 1);
                            totalHeight += (len - i - 1) * averageHeight;
                            break;
                        }
                    }

                    int state;
                    if (dummyView.Tag == null)
                    {
                        state = STATE_IDLE;
                    }
                    else
                    {
                        state = ((Integer)dummyView.Tag).IntValue();
                    }

                    if (info.expanding && state != STATE_EXPANDING)
                    {
                        ExpandAnimation ani = new ExpandAnimation(dummyView, 0, totalHeight, info);
                        ani.Duration = ANIMATION_DURATION;

                        ExpandableAnimationListener expandAnimationListener = new ExpandableAnimationListener(this, state, groupPosition, dummyView, listView, info);
                        ani.SetAnimationListener(expandAnimationListener);

                        dummyView.StartAnimation(ani);
                        dummyView.Tag = STATE_EXPANDING;
                    }
                    else if (!info.expanding && state != STATE_COLLAPSING)
                    {
                        if (info.dummyHeight == -1)
                        {
                            info.dummyHeight = totalHeight;
                        }

                        ExpandAnimation ani = new ExpandAnimation(dummyView, info.dummyHeight, 0, info);
                        ani.Duration = ANIMATION_DURATION;

                        ExpandableAnimationListener collapseAnimationListener = new ExpandableAnimationListener(this, state, groupPosition, dummyView, listView, info);
                        ani.SetAnimationListener(collapseAnimationListener);

                        dummyView.StartAnimation(ani);
                        dummyView.Tag = STATE_COLLAPSING;
                    }

                    return(convertView);
                }
                else
                {
                    return(GetRealChildView(groupPosition, childPosition, isLastChild, convertView, parent));
                }
            }
Пример #14
0
        private void refreeBtn_Click(object sender, EventArgs e)
        {
            ExpandAnimation en = new ExpandAnimation();

            en.Start(tableLayoutPanel1, new Size(200, 500), TransitionType.Linear, 20);
        }
Пример #15
0
        private void ListcloseBtn_Click(object sender, EventArgs e)
        {
            ExpandAnimation en = new ExpandAnimation();

            en.Start(memberListPanel, new Size(580, 0), TransitionType.EaseInExpo, 20);
        }
            /**
             * Override {@link #getChildView(int, int, bool, View, ViewGroup)} instead.
             */


            public override View GetChildView(int groupPosition, int childPosition, bool isLastChild, View convertView, ViewGroup parent)
            {
                try
                {
                    GroupInfo info = getGroupInfo(groupPosition);
                    info.ChildViewCallCount += 1;;
                    if (info.animating)
                    {
                        // If this group is animating, return the a DummyView...
                        if (convertView is DummyView == false)
                        {
                            convertView = new DummyView(parent.Context);
                            convertView.LayoutParameters = new AbsListView.LayoutParams(LayoutParams.MatchParent, 0);
                        }

                        if (childPosition < info.firstChildPosition)
                        {
                            // The reason why we do this is to support the collapse
                            // this group when the group view is not visible but the
                            // children of this group are. When notifyDataSetChanged
                            // is called, the ExpandableListView tries to keep the
                            // list position the same by saving the first visible item
                            // and jumping back to that item after the views have been
                            // refreshed. Now the problem is, if a group has 2 items
                            // and the first visible item is the 2nd child of the group
                            // and this group is collapsed, then the dummy view will be
                            // used for the group. But now the group only has 1 item
                            // which is the dummy view, thus when the ListView is trying
                            // to restore the scroll position, it will try to jump to
                            // the second item of the group. But this group no longer
                            // has a second item, so it is forced to jump to the next
                            // group. This will cause a very ugly visual glitch. So
                            // the way that we counteract this is by creating as many
                            // dummy views as we need to maintain the scroll position
                            // of the ListView after notifyDataSetChanged has been
                            // called.
                            convertView.LayoutParameters.Height = 0;
                            return(convertView);
                        }

                        AnimatedExpandableListView listView = (AnimatedExpandableListView)parent;

                        DummyView dummyView = (DummyView)convertView;

                        // Clear the views that the dummy view draws.
                        dummyView.clearViews();

                        // Set the style of the divider
                        dummyView.setDivider(listView.Divider, parent.MeasuredWidth, listView.DividerHeight);

                        // Make measure specs to measure child views
                        int measureSpecW = MeasureSpec.MakeMeasureSpec(parent.Width, MeasureSpecMode.Exactly);
                        int measureSpecH = MeasureSpec.MakeMeasureSpec(0, MeasureSpecMode.Unspecified);

                        int totalHeight = 0;
                        int clipHeight  = parent.Height;

                        int len = getRealChildrenCount(groupPosition);
                        for (int i = info.firstChildPosition; i < len; i++)
                        {
                            View childView = getRealChildView(groupPosition, i, (i == len - 1), null, parent);

                            LayoutParams p = (LayoutParams)childView.LayoutParameters;
                            if (p == null)
                            {
                                p = (AbsListView.LayoutParams)generateDefaultLayoutParams();
                                childView.LayoutParameters = p;
                            }

                            int lpHeight = p.Height;

                            int childHeightSpec;
                            if (lpHeight > 0)
                            {
                                childHeightSpec = MeasureSpec.MakeMeasureSpec(lpHeight, MeasureSpecMode.Exactly);
                            }
                            else
                            {
                                childHeightSpec = measureSpecH;
                            }

                            childView.Measure(measureSpecW, childHeightSpec);
                            totalHeight += childView.MeasuredHeight;

                            if (totalHeight < clipHeight)
                            {
                                // we only need to draw enough views to fool the user...
                                dummyView.addFakeView(childView);
                            }
                            else
                            {
                                dummyView.addFakeView(childView);

                                // if this group has too many views, we don't want to
                                // calculate the height of everything... just do a light
                                // approximation and break
                                int averageHeight = totalHeight / (i + 1);
                                totalHeight += (len - i - 1) * averageHeight;
                                break;
                            }
                        }

                        object o = dummyView.Tag;


                        Java.Lang.Number state = o == null ? STATE_IDLE : (Java.Lang.Number)o;

                        if (info.expanding && state != STATE_EXPANDING && info.ChildViewCallCount <= 1) //&& info.ChildViewCallCount<=1
                        {
                            //new System.Threading.Thread(new System.Threading.ThreadStart(delegate
                            //{
                            //  _activity.RunOnUiThread(() =>
                            //{
                            ExpandAnimation ani = new ExpandAnimation(dummyView, 0, totalHeight, info, _activity, this);

                            ani.Duration = this.parent.getAnimationDuration();
                            //ani.SetInterpolator(_activity, Android.Resource.Animation.LinearInterpolator);
                            ani.Interpolator = new AccelerateDecelerateInterpolator();
                            ani.SetAnimationListener(new CustomAnimateListener(STATE_EXPANDING, groupPosition, dummyView, info, listView,
                                                                               this, listView.OnAnimationEnd));
                            //ani.FillAfter = false;
                            dummyView.StartAnimation(ani);
                            //ani.RepeatCount = Animation.StartOnFirstFrame;


                            /*****************Another Animation Implementation*****************
                             * ValueAnimator animator = ValueAnimator.OfInt(0, totalHeight);
                             *    animator.SetDuration(this.parent.getAnimationDuration());
                             *    animator.SetInterpolator(new AccelerateDecelerateInterpolator());
                             *
                             *    animator.Update += (object sender, ValueAnimator.AnimatorUpdateEventArgs e) =>
                             *    {
                             *
                             *
                             *        var value = (int)animator.AnimatedValue;
                             *        if (factor != value)
                             *        {
                             *            factor = value;
                             *            ViewGroup.LayoutParams layoutParams = dummyView.LayoutParameters;
                             *            layoutParams.Height = value;
                             *            dummyView.LayoutParameters = layoutParams;
                             *            Console.System.Diagnostics.Debug.WriteLine("Value: " + value.ToString());
                             *        }
                             *
                             *    };
                             * animator.AddListener(new CustomAnimateListener(STATE_EXPANDING, groupPosition, dummyView, info, listView, this));
                             * * ************************/



                            dummyView.Tag = STATE_EXPANDING;
                            // });
                            //})).Start();
                        }
                        else if (!info.expanding && state != STATE_COLLAPSING && info.ChildViewCallCount <= 1)  //&& info.ChildViewCallCount<=1
                        {
                            if (info.dummyHeight == -1)
                            {
                                info.dummyHeight = totalHeight;
                            }
                            //new System.Threading.Thread(new System.Threading.ThreadStart(delegate
                            //{
                            //  _activity.RunOnUiThread(() =>
                            //{
                            ExpandAnimation ani = new ExpandAnimation(dummyView, info.dummyHeight, 0, info, _activity, this);
                            ani.Duration = this.parent.getAnimationDuration();
                            //ani.SetInterpolator(_activity, Android.Resource.Animation.AccelerateInterpolator);
                            ani.Interpolator = new AccelerateDecelerateInterpolator();
                            ani.SetAnimationListener(new CustomAnimateListener(STATE_COLLAPSING, groupPosition, dummyView, info, listView,
                                                                               this, listView.OnAnimationEnd));
                            long i = ani.ComputeDurationHint();
                            dummyView.StartAnimation(ani);

                            /**********************************Another animation implementation********************
                             * ValueAnimator animator = ValueAnimator.OfInt(totalHeight, 0);
                             *                         animator.SetDuration(this.parent.getAnimationDuration());
                             *                         animator.SetInterpolator(new AccelerateDecelerateInterpolator());
                             *                         animator.Update += (object sender, ValueAnimator.AnimatorUpdateEventArgs e) =>
                             *                         {
                             *                             var value = (int)animator.AnimatedValue;
                             *                             if (factor != value)
                             *                             {
                             *                                 factor = value;
                             *                                 ViewGroup.LayoutParams layoutParams = dummyView.LayoutParameters;
                             *                                 layoutParams.Height = value;
                             *                                 dummyView.LayoutParameters = layoutParams;
                             *                                 Console.System.Diagnostics.Debug.WriteLine("Value: " + value.ToString());
                             *                             }
                             *                         };
                             *                         animator.AddListener(new CustomAnimateListener(STATE_COLLAPSING,groupPosition,dummyView,info,listView,this));
                             * animator.Start();
                             * ****************************************/

                            dummyView.Tag = STATE_COLLAPSING;
                            // });
                            //})).Start();
                        }

                        return(convertView);
                    }
                    else
                    {
                        info.ChildViewCallCount = 0;
                        return(getRealChildView(groupPosition, childPosition, isLastChild, convertView, parent));
                    }
                }
                catch (System.Exception ex)
                {
                    string s = ex.Message;

                    CustomLogger.CustomLog("From Activity: " + BitopiSingelton.Instance.CurrentActivity + "\nMessage: " + ex.Message + "\nStack Trace: " + ex.StackTrace + "\n\n", "", BitopiSingelton.Instance.User != null ?
                                           BitopiSingelton.Instance.User.UserName : "");
                    return(null);
                }
            }
Пример #17
0
        private void animatePanel(int width, int height)
        {
            ExpandAnimation en = new ExpandAnimation();

            en.Start(activePanel, new Size(width, height), TransitionType.Linear, 20);
        }