Stack Exchange
System.InvalidCastException: 'Unable to cast object of type 'System.Windows.Controls.TextBox' to type 'System.IConvertible'.'
I am tring to move the value which is in textbox3 onto a new page but I keep getting an error (see title)
Anybody know how to fix it?
XAML
       <TextBox x:Name="textbox1" Width="200" Height="30" Margin="251,50,349,370" Text="{Binding Content, ElementName=label1}"/>
        <TextBox x:Name="textbox2" Width="200" Height="30" Margin="0,-292,30,328" Text="10"/>
        <TextBox x:Name="textbox3" Width="200" Height="30" Margin="0,-500,45,281" Text="0"/>

CS  
         double v1;
         double v2;
         double.TryParse(textbox1.Text, out v1);
        double.TryParse(textbox2.Text, out v2);
        double v3;
        double.TryParse(textbox3.Text, out v3);

        textbox3.Text = Convert.ToDouble(v1 * v2).ToString();



        TotalHere.TotalNumbers = Convert.ToDouble(textbox3);
        Switcher.Switch(new Page2());


You need to reference the text property rather than the textbox itself. 
Try changing this:
TotalHere.TotalNumbers = Convert.ToDouble(textbox3);

To:
TotalHere.TotalNumbers = Convert.ToDouble(textbox3.Text);


Yep, that was it. Thanks

I would suggest you to use double.TryParse on the Text property of the textBox instead of directly passing it.
Advantage of TryParse method is that you can also check whether the given value is convertible to double or not based on its return value true or false.
Read this
If not then you can also handle that case as well.
