Ejemplo n.º 1
0
        private void CreateItem(ExpanderView list, String groupName)
        {
            var    transform      = list.TransformToVisual(Application.Current.RootVisual);
            var    pointOffset    = transform.Transform(new Point(0, 0));
            double verticalOffset = pointOffset.Y - 50;

            var createItem = new CreateItemControl()
            {
                GroupName = groupName
            };

            SetPopupedControlEvent(createItem);

            createItem.Closed += delegate(object sender, PopupEventArgs e)
            {
                list.IsExpanded = true;
                if (verticalOffset > 0)
                {
                    var storyboard2 = AnimationUtils.GetStoryboard();
                    AnimationUtils.SetHeightAnimation(storyboard2, VacancyStackPanel as FrameworkElement, 0, 0.3);
                    storyboard2.Begin();
                }

                if (e.Done)//Expand the new item
                {
                    FrameworkElement item = list.Items[0] as FrameworkElement;
                    if (item != null)
                    {
                        StackPanel panel = item.FindName("ItemPanel") as StackPanel;
                        if (panel != null)
                        {
                            if (mCurrentItemPanel != null)
                            {
                                HideItemDetails(mCurrentItemPanel);
                            }
                            ShowItemDetails(panel);
                            mCurrentItemPanel = panel;
                        }
                    }
                }
            };

            if (verticalOffset == 0)
            {
                PopupWindow.ShowWindow(createItem);
            }
            else
            {
                var storyboard = AnimationUtils.GetStoryboard();
                if (verticalOffset > 0)
                {
                    AnimationUtils.SetHeightAnimation(storyboard, VacancyStackPanel as FrameworkElement, verticalOffset + 1000, 0.3);
                }
                AnimationUtils.SetAnyAnimation(storyboard, this as FrameworkElement, ScrowViewerVerticalOffsetProperty,
                                               MainScrollViewer.VerticalOffset, MainScrollViewer.VerticalOffset + verticalOffset, 0.3);

                storyboard.Completed += delegate(object sender, EventArgs e)
                {
                    PopupWindow.ShowWindow(createItem);
                };
                storyboard.Begin();
            }
        }
Ejemplo n.º 2
0
 public MyDrivePage(IWebDriver driver) : base(driver)
 {
     this.CreateItemControl = new CreateItemControl(driver);
 }