Esempio n. 1
0
 private void OnBlockSelected(object item)
 {
     if (item != null && item is NavBlock)
     {
         NavBlock block = (NavBlock)item;
         if (block.IsLeaf)
         {
             if (block.IsSearch)
             {
                 HistoryHandler.Instance.openPage(block.NavigationToken);
             }
             else
             {
                 HistoryHandler.Instance.openPage(block.NavigationToken);
             }
         }
         else
         {
             this.SubDashboardLayout.Clear();
             foreach (NavBlock child in block.Children)
             {
                 child.ParentBlock      = block;
                 child.AllowContextMEnu = false;
                 this.SubDashboardLayout.AddBlock(child);
             }
         }
     }
 }
Esempio n. 2
0
 public void RemoveBlock(NavBlock block)
 {
     block.Selection -= OnBlockSelected;
     block.Hide      -= OnBlockHided;
     block.Edit      -= OnBlockEdited;
     this.Children.Remove(block);
     block.Dispose();
 }
Esempio n. 3
0
 private void OnBlockEdited(object item)
 {
     if (item != null && item is NavBlock)
     {
         NavBlock block = (NavBlock)item;
         NavDashboardBlockPropertiesDialog dialog = new NavDashboardBlockPropertiesDialog();
         dialog.EditBlock(block);
     }
 }
Esempio n. 4
0
 public void AddBlock(NavBlock block)
 {
     block.Selection -= OnBlockSelected;
     block.Hide      -= OnBlockHided;
     block.Edit      -= OnBlockEdited;
     block.Selection += OnBlockSelected;
     block.Hide      += OnBlockHided;
     block.Edit      += OnBlockEdited;
     this.Children.Add(block);
 }
Esempio n. 5
0
 private void OnBlockHided(object item)
 {
     if (item != null && item is NavBlock)
     {
         NavBlock block = (NavBlock)item;
         this.DashboardLayout.RemoveBlock(block);
         if (block.Category != null)
         {
             block.Category.IsEnabled = true;
         }
     }
 }
Esempio n. 6
0
 public void EditBlock(NavBlock block)
 {
     this.Block = block;
     if (block.Content is TextBlock)
     {
         this.Title = ((TextBlock)block.Content).Text + " - Properties";
     }
     else
     {
         this.Title = block.Content.ToString() + " - Properties";
     }
     this.ShapePopupColorEdit.Color = block.BackgroundColor;
     this.TextPopupColorEdit.Color  = block.ForegroundColor;
     WindowPositioner.ShowCenteredToMouse(this);
     //this.ShowDialog();
 }