Assuming that textbox1
holds a reference to the wanted TextBox
, that TextBox
is also held by the UI tree (and this is what the UI shows...). When you change the value of textbox1
it is changed only in that variable and, changes nothing in the UI.
If you want to change the UI, you can load the TextBox
to another variable and, change the wanted values in the UI's TextBox
. Something like:
TextBox tb = (TextBox) new XmlObjectSerializer().Deserialize(File.ReadAllText(@"WPFUISerialization.Xml"));
textbox1.Text = tb.Text;