示例#1
0
        public void SetTopBoardControlView(IBoardControlView boardControlView)
        {
            var maxZIndex = boardControlViews.Where(x => x != boardControlView).Aggregate(0, (acc, bc) => Math.Max(acc, Canvas.GetZIndex((Windows.UI.Xaml.UIElement)bc.Control)));

            Canvas.SetZIndex((Windows.UI.Xaml.UIElement)boardControlView.Control, maxZIndex + 1);
            Canvas.SetZIndex(selectedControlTools, maxZIndex + 2);
        }
示例#2
0
        public void Show(IBoardControlView boardControlView)
        {
            Hide();

            this.BoardControlView = boardControlView;

            Visibility = Visibility.Visible;

            UpdatePosition();

            RegisterCallbacks();
        }
示例#3
0
        private void RemoveBoardControlView(IBoardControlView boardControlView)
        {
            if (boardControlView == null)
            {
                return;
            }

            if (boardControlView == selectedControlView)
            {
                SetSelectedBoardControlView(null);
            }

            boardControlView.StopEdit();
            boardControlViews.Remove(boardControlView);
            mainCanvas.Children.Remove((Windows.UI.Xaml.UIElement)boardControlView.Control);
        }
示例#4
0
        private void SetSelectedBoardControlView(IBoardControlView value)
        {
            if (selectedControlView != value)
            {
                if (selectedControlView != null)
                {
                    selectedControlView.Selected = false;
                }

                selectedControlView = value;
            }

            if (selectedControlView != null)
            {
                selectedControlView.Selected = true;
                selectedControlTools.Show(selectedControlView);
                var maxZIndex = boardControlViews.Aggregate(0, (acc, bc) => Math.Max(acc, Canvas.GetZIndex((Windows.UI.Xaml.UIElement)bc.Control)));
                Canvas.SetZIndex(selectedControlTools, maxZIndex + 1);
            }
            else
            {
                selectedControlTools.Hide();
            }
        }
示例#5
0
        private void AddBoardControlView(IBoardControlView boardControlView)
        {
            mainCanvas.Children.Add((Windows.UI.Xaml.UIElement)boardControlView.Control);

            boardControlViews.Add(boardControlView);
        }
示例#6
0
 private void InitBoardControlView(IBoardControlView boardControlView, BoardControlViewModel boardControlViewModel)
 {
     boardControlView.Init(this, boardControlViewModel);
 }