Hi
In order to add some hidden "meta data" to our RadDocuments
we decided to derive the Section class and add
Now we can create documents in XAML such as:
However when saving the Document with XamlFormatProvider
the Metadata stuff is removed.
When Debugging my metadata class I can see a two instances
are created and the two props are assigned on load.
When I try an add the [XamlSerializable] attribute to my property
and also to the properties of the MetaData class
I get an runtime XamlParseException on loading the document:
Can't convert object of type "System.String" to "ObservableCollection<MyNameSapce.MetaData>"
The line in question is:
So it seems the XamlFormatProvider can't deal with the markup properly.
Is there a way to "tell" the XamlFormatprovider how (de)serialize my meta data collection
Do I need to specify a typeconverter or value converter also?
Thanks
In order to add some hidden "meta data" to our RadDocuments
we decided to derive the Section class and add
public class EditorSection : Section
{
private ObservableCollection<
Metadata
> _metadata = new ObservableCollection<
Metadata
>();
//[XamlSerializable]
public ObservableCollection<
Metadata
> Metadata
{
get { return _metadata; }
set { _metadata = value; }
}
}
Now we can create documents in XAML such as:
<
c:Editor
Section
>
<
c:Editor
Section
.Metadata
>
<
c:Metadata
Name
=
"DocumentId"
Value
=
"{00000-..-..-..}"
/>
<
c:Metadata
Name
=
"Owner"
Value
=
"JohnWSmith"
/>
</
c:Editor
Section
.Metadata
>
<
t:Paragraph
>
<
t:Span
Text
=
"Hi"
>
</
t:Span
>
</
t:Paragraph
>
</
c:
Editor
Section
>
However when saving the Document with XamlFormatProvider
the Metadata stuff is removed.
When Debugging my metadata class I can see a two instances
are created and the two props are assigned on load.
When I try an add the [XamlSerializable] attribute to my property
and also to the properties of the MetaData class
I get an runtime XamlParseException on loading the document:
Can't convert object of type "System.String" to "ObservableCollection<MyNameSapce.MetaData>"
The line in question is:
Telerik.Windows.Documents.FormatProviders.Xaml.XamlFormatProvider.Import(String input) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\FormatProviders\Xaml\XamlFormatProvider.cs:Line 126.
So it seems the XamlFormatProvider can't deal with the markup properly.
Is there a way to "tell" the XamlFormatprovider how (de)serialize my meta data collection
Do I need to specify a typeconverter or value converter also?
Thanks