I can retrieve the xaml with rtb.xaml.ToString() and store it in a database. But how do I set it? As an example, I thought rtb2.Xaml = rtb.Xaml would work.
A:
The Xaml
property is a of type String
so there is no need to use ToString
on it.
You simply store the content of Xaml
as a string in a database and restore it later with a simply assignment:-
rtb.Xaml = myXamlString;
Howeever you should note that only a limited number of elements will actuall serialise in this wa, you can't expect embedded controls like ComboBox
to serialise. In addition only relevant properties of the remaining elements will serialise, again those related to the appearance of the text.
For details see the documentation.
AnthonyWJones
2010-08-04 12:20:57