hello I am trying to get values from 3 different control types (text box, Radio button and Slider) to compute a monthly payment for a loan. I am having trouble getting the value for the radio button and the slider. 

There are 3 radio buttons for year(15,30, other) if other is checked then the user inputs the year in a text box. 

The slider gathers the interest rate. I am unsure how to get the value that the user slides too. 

The output should be in a label. 

```
    private void RadioButton_Checked(object sender, RoutedEventArgs e)
    {

    }
    void radiobutton_CheckChanged(object sender, RoutedEventArgs e)
    {
        //txtYears.IsEnabled = btn3.IsChecked;
    }

    private void sldRate_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
    {

    }

    private void btnSubmit_Click(object sender, RoutedEventArgs e)
    {

        double p, yrs, r, m;

        double.TryParse(txtPrin.Text, out p);

        foreach (RadioButton button in stkYears.Children)
        {
            if (button.IsChecked.Value)
            {
                if (button.Content.ToString() == "Other")
                    txtYears.IsEnabled = btn3.IsChecked;           
            }
        }
        double.TryParse(txtYears.Text, out yrs);

        m = (txtPrin *  )
            //the above statment should  look like this 
            //m = (p * r / 1200.0) / (1 - Math.Pow((1.0 + r / 1200.0), (-12 * yrs)));
        lblMonthlyPayment.TextInput = m.ToString();           

    }

```

below is the xaml

```
<Label Content="Number Of Years" HorizontalAlignment="Left" VerticalAlignment="Top" Width="175" FontFamily="NSimSun" FontSize="14" Height="26" Grid.Row="1" Margin="0,28,0,0"/>
        <StackPanel Grid.Column="1" Name="stkYears" Margin="0,6,0,0" Grid.Row="1">
            <RadioButton x:Name="btn1" GroupName="Years" Content="15 Years" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="99" Height="15" FontFamily="Shruti" Grid.Column="1" Grid.Row="1"/>
            <RadioButton GroupName="Years"  Content="30 Years" HorizontalAlignment="Left" Margin="10,1,0,0" VerticalAlignment="Top" Width="99" Height="15" FontFamily="Shruti" />
            <RadioButton x:Name="btn3" GroupName="Years"  Checked="radioButton_CheckChanged" Unchecked="radioButton_CheckChanged" Content="Other" HorizontalAlignment="Left" Margin="10,1,0,0" 
                           VerticalAlignment="Top" Width="99" Height="15" FontFamily="Shruti" IsChecked="True"/>
            <TextBox x:Name="txtYears" Height="17" Margin="30,0,168,0"/>
        </StackPanel>

        <Label Content="Interest Rate" HorizontalAlignment="Left" Margin="0,27,0,0" VerticalAlignment="Top" Width="188" FontFamily="NSimSun" FontSize="14" Height="24" Grid.Row="2" Grid.ColumnSpan="2"/>
        <Slider HorizontalAlignment="Left" Name="sldRate" IsSnapToTickEnabled="True" TickPlacement="BottomRight" 
             AutoToolTipPlacement="BottomRight" TickFrequency="3"
             AutoToolTipPrecision="2" IsDirectionReversed="False"
             IsMoveToPointEnabled="False" Margin="13,27,-18,0" VerticalAlignment="Top" Width="291" Minimum="0" Maximum="6" Ticks="0, 1, 2, 3, 4, 5, 6" ValueChanged="sldRate_ValueChanged" Height="51" Background="White" Foreground="Black" BorderBrush="#00000000" Grid.Column="1" Grid.Row="2"/>

        <Button Name ="btnSubmit" Content="Calculate Monthly Payment" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="165" Click="btnSubmit_Click" Height="30" Grid.Row="3" RenderTransformOrigin="0.5,0.5"/>
        <Label x:Name="lblMonthlyPayment" Content="" Grid.Column="1" HorizontalAlignment="Left" Margin="13,15,0,0" Grid.Row="3" VerticalAlignment="Top" Width="124" IsEnabled="False" />

```