void IconDrawer_IconChanged(IconDrawer id, IconDrawer.IconChangedArgs e)
 {
     if (currentitem != null)
     {
         currentitem.Icon = e.ChangedTo;
     }
 }
        private ItemControl(string title, string content, IconEnum icon, bool expanded)
            : this()
        {
            Header.Text = title;
            textBox.Document.Blocks.Clear();
            textBox.Document.Blocks.Add(new Paragraph(new Run(content)));
            IconDrawer.SetIcon(icon);

            if (!expanded)
            {
                Collapse();
            }
        }
        private void Collapse()
        {
            isExpanded            = false;
            collapseButton.Source = (BitmapImage)Application.Current.Resources["expand"];

            BackgroundGrid.Height  = headerGrid.Height;
            ContentGrid.Visibility = System.Windows.Visibility.Collapsed;
            foreach (UIElement item in ContentGrid.Children)
            {
                item.Visibility = System.Windows.Visibility.Collapsed;
            }
            IconDrawer.CloseDrawer();

            if (currentitem != null)
            {
                currentitem.Expanded = false;
            }
        }
 void textBox_GotFocus(object sender, RoutedEventArgs e)
 {
     IconDrawer.CloseDrawer();
 }
 void Header_GotFocus(object sender, RoutedEventArgs e)
 {
     IconDrawer.CloseDrawer();
 }