Radio Button Isenabled trouble <p>I'm setting a combobox to be enabled based on selection of Radioboxes. Currently it's producing this error <code>Object reference not set to an instance of an object.</code> for the following code below. I did it one at a time and to make the ComboBox False works. When I implemented Disc_OnChecked to Set to true it produced the error. If I can get help to bypass this error please.</p> <pre><code>private void Cont_OnChecked(object sender, RoutedEventArgs e) { Cf.IsEnabled = false; } private void Disc_OnChecked(object sender, RoutedEventArgs e) { Cf.IsEnabled = true; } </code></pre> <p>Xaml code:</p> <pre><code>&lt;GroupBox&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;TextBlock Text="Type: "&gt;&lt;/TextBlock&gt; &lt;RadioButton Checked="Disc_OnChecked" GroupName="Group1" x:Name="Disc" IsChecked="true" Content="Discrete" &gt;&lt;/RadioButton&gt; &lt;RadioButton Checked="Cont_OnChecked" GroupName="Group1" x:Name="Cont" Content="Continuous"&gt;&lt;/RadioButton&gt; &lt;/StackPanel&gt; &lt;/GroupBox&gt; &lt;ComboBox x:Name="Cf" Width="125" SelectedIndex="1"&gt; &lt;ComboBoxItem Content="Annual"&gt;&lt;/ComboBoxItem&gt; &lt;ComboBoxItem Content="Semi-annual"&gt;&lt;/ComboBoxItem&gt; &lt;/ComboBox&gt; </code></pre>