public override void Dispose() { base.Dispose(); DisposeTextBlock(TextBlock1); TextBlock1 = null; DisposeTextBlock(TextBlock2); TextBlock2 = null; DisposeTextBlock(TextBlock3); TextBlock3 = null; DisposeTextBlock(TextBlock4); TextBlock4 = null; DisposeTextBlock(TextBlock5); TextBlock5 = null; DisposeTextBlock(TextBlock6); TextBlock6 = null; DisposeTextBlock(TextBlock7); TextBlock7 = null; DisposeTextBlock(TextBlock8); TextBlock8 = null; DisposeTextBlock(TextBlock9); TextBlock9 = null; DisposeTextBlock(TextBlock10); TextBlock10 = null; DisposeTextBlock(TextBlock11); TextBlock11 = null; DisposeTextBlock(TextBlock12); TextBlock12 = null; DisposeTextBlock(TextBlock13); TextBlock13 = null; DisposeTextBlock(TextBlock14); TextBlock14 = null; DisposeTextBlock(TextBlock15); TextBlock15 = null; Button1.Click -= Button_Click_1; DisposeButton(Button1); Button1 = null; DisposeRadioButton(rdDoc); rdDoc = null; DisposeRadioButton(rdDocx); rdDocx = null; DisposeCheckBox(checkBox1); checkBox1 = null; DisposeCheckBox(checkBox2); checkBox2 = null; comboBox1.ClearValue(ComboBox.FontFamilyProperty); comboBox1.ClearValue(ComboBox.FontSizeProperty); comboBox1.ClearValue(ComboBox.ForegroundProperty); comboBox1 = null; stackPnlOptions.ClearValue(StackPanel.OrientationProperty); stackPnlOptions.ClearValue(StackPanel.HorizontalAlignmentProperty); stackPnlOptions = null; HeaderFooter.ClearValue(Grid.BackgroundProperty); HeaderFooter.ClearValue(Grid.PaddingProperty); HeaderFooter.Children.Clear(); HeaderFooter.ColumnDefinitions.Clear(); HeaderFooter.RowDefinitions.Clear(); HeaderFooter = null; }