Esempio n. 1
0
        public void Dispose()
        {
            if (this.diagramControl != null && this.diagramControl.Info is IGraphInfo)
            {
                (this.diagramControl.Info as IGraphInfo).ItemSelectedEvent -= Diagram_ItemSelectedEvent;
            }

            Part_FontColor.SelectedBrushChanged -= Part_FontColor_SelectedBrushChanged;
            Part_FontColor.HeaderTemplate        = null;
            Part_FontColor.Dispose();
            Part_FontColor = null;

            Part_FillColor.SelectedBrushChanged -= Part_FillColor_SelectedBrushChanged;
            Part_FillColor.HeaderTemplate        = null;
            Part_FillColor.Dispose();
            Part_FillColor = null;

            Part_StrokeColor.SelectedBrushChanged -= Part_StrokeColor_SelectedBrushChanged;
            Part_StrokeColor.HeaderTemplate        = null;
            Part_StrokeColor.Dispose();
            Part_StrokeColor = null;

            Part_Background.SelectedBrushChanged -= BackgroundColorPickerPalatte_SelectedBrushChanged;
            Part_Background.HeaderTemplate        = null;
            Part_Background.Dispose();
            Part_Background = null;

            homePanel.Children.Clear();
            designPanel.Children.Clear();
            viewPanel.Children.Clear();
            layoutPanel.Children.Clear();

            tabControl.Items.Clear();
            tabControl.Dispose();
        }
Esempio n. 2
0
        protected override void Dispose(bool disposing)
        {
            if (this.DataContext != null)
            {
                this.DataContext = null;
            }

            if (this.Diagram != null)
            {
                this.Diagram = null;
            }

            Part_FontColor.Dispose();
            Part_FillColor.Dispose();
            Part_StrokeColor.Dispose();

            base.Dispose(disposing);
        }