public void HideVisiblePanel()
 {
     if (visiblePanel != null)
     {
         visiblePanel.Visibility = System.Windows.Visibility.Collapsed;
         visiblePanel            = null;
     }
 }
 public void HideVisiblePanel()
 {
     if (visiblePanel != null)
     {
         visiblePanel.Visibility = System.Windows.Visibility.Collapsed;
         visiblePanel = null;
     }
 }
 void ChangeActivePanel(object sender)
 {
     if (visiblePanel != null)
     {
         visiblePanel.Visibility = System.Windows.Visibility.Collapsed;
         buttonPanelMapping[sender].Visibility = System.Windows.Visibility.Visible;
         visiblePanel = buttonPanelMapping[sender];
     }
 }
 void ChangeActivePanel(object sender)
 {
     if (visiblePanel != null)
     {
         visiblePanel.Visibility = System.Windows.Visibility.Collapsed;
         buttonPanelMapping[sender].Visibility = System.Windows.Visibility.Visible;
         visiblePanel = buttonPanelMapping[sender];
     }
 }
 void CreatePanel(List<CommandDetails> list, Button toolBarButton, int columns, int margin)
 {
     ButtonPanel bp = new ButtonPanel(list, columns, margin);
     bp.ButtonClick += (x, y) => { CommandCompleted(this, EventArgs.Empty); visiblePanel = null; };
     mainToolBarPanel.Children.Add(bp);
     Canvas.SetTop(bp, mainToolBarPanel.Height);
     Vector offset = VisualTreeHelper.GetOffset(toolBarButton);
     Canvas.SetLeft(bp, offset.X + 2);
     bp.Visibility = System.Windows.Visibility.Collapsed;
     buttonPanelMapping.Add(toolBarButton, bp);
 }
 private void toolBarButton_Click(object sender, RoutedEventArgs e)
 {
     if (visiblePanel != null)
     {
         visiblePanel.Visibility = System.Windows.Visibility.Collapsed;
     }
     if (buttonPanelMapping[sender].Visibility != System.Windows.Visibility.Visible)
     {
         buttonPanelMapping[sender].Visibility = System.Windows.Visibility.Visible;
         visiblePanel = buttonPanelMapping[sender];
     }
 }
 private void toolBarButton_Click(object sender, RoutedEventArgs e)
 {
     if (visiblePanel != null)
     {
         visiblePanel.Visibility = System.Windows.Visibility.Collapsed;
     }
     if (buttonPanelMapping[sender].Visibility != System.Windows.Visibility.Visible)
     {
         buttonPanelMapping[sender].Visibility = System.Windows.Visibility.Visible;
         visiblePanel = buttonPanelMapping[sender];
     }
 }
        void CreatePanel(List <CommandDetails> list, Button toolBarButton, int columns, int margin)
        {
            ButtonPanel bp = new ButtonPanel(list, columns, margin);

            bp.ButtonClick += (x, y) => { CommandCompleted(this, EventArgs.Empty); visiblePanel = null; };
            mainToolBarPanel.Children.Add(bp);
            Canvas.SetTop(bp, mainToolBarPanel.Height);
            Vector offset = VisualTreeHelper.GetOffset(toolBarButton);

            Canvas.SetLeft(bp, offset.X + 2);
            bp.Visibility = System.Windows.Visibility.Collapsed;
            buttonPanelMapping.Add(toolBarButton, bp);
        }