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); }
public void Show(IBoardControlView boardControlView) { Hide(); this.BoardControlView = boardControlView; Visibility = Visibility.Visible; UpdatePosition(); RegisterCallbacks(); }
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); }
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(); } }
private void AddBoardControlView(IBoardControlView boardControlView) { mainCanvas.Children.Add((Windows.UI.Xaml.UIElement)boardControlView.Control); boardControlViews.Add(boardControlView); }
private void InitBoardControlView(IBoardControlView boardControlView, BoardControlViewModel boardControlViewModel) { boardControlView.Init(this, boardControlViewModel); }