Пример #1
0
        private void AddDrawing(Grizzlist.Tasks.Types.Drawing drawing)
        {
            DrawingEditorControl editor = new DrawingEditorControl(drawing, true);
            TabItem tabItem             = new TabItem()
            {
                Header = drawing.Name
            };

            tabItem.Content = editor;
            tcTask.Items.Add(tabItem);
        }
        private TabItem AddDrawing(Drawing drawing)
        {
            DrawingEditorControl editor = new DrawingEditorControl(drawing);
            TabItem tabItem             = new TabItem()
            {
                Header = drawing.Name
            };

            editor.OnRename     += name => tabItem.Header = name;
            editor.OnValidation += result => tabItem.BorderBrush = result ? new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(172, 172, 172)) : System.Windows.Media.Brushes.Red;
            editor.OnDelete     += () =>
            {
                drawings.Remove(editor);
                tcTask.Items.Remove(tabItem);
            };

            tabItem.Content = editor;
            tcTask.Items.Add(tabItem);
            drawings.Add(editor);

            return(tabItem);
        }