Hi.
We need to set/tag spans in the document with some custom data (of type string), so I've created a custom StylePropertyDefinition (e.g. like the Span.FontWeightProperty property, but our doesn't need to change the layout) and are trying to apply this to a span - but it doesn't seem to work.
Note: We serialize and deserialize the RadDocument ourselves - so I just need to be able to set this property runtime on a span and have that in memory until the document is deserialized.
Now I cant find any documentation or examples of doing this...
Is it possible to do something like this?
Here's my prop definition:
(PS: Dont know what I should do in the "Selector" lambda - so I return null)
I'm trying to set the custom property like this:
And read it like this:
Any help would be very much appreciated!
We need to set/tag spans in the document with some custom data (of type string), so I've created a custom StylePropertyDefinition (e.g. like the Span.FontWeightProperty property, but our doesn't need to change the layout) and are trying to apply this to a span - but it doesn't seem to work.
Note: We serialize and deserialize the RadDocument ourselves - so I just need to be able to set this property runtime on a span and have that in memory until the document is deserialized.
Now I cant find any documentation or examples of doing this...
Is it possible to do something like this?
Here's my prop definition:
public
static
readonly
StylePropertyDefinition<
string
, Span, Paragraph> TextMetaInfoProperty =
new
StylePropertyDefinition<
string
, Span, Paragraph>(
"TextMetaInfo"
, StylePropertyOptions.AffectsLayout, (s) => {
return
null
; },
default
(
string
));
I'm trying to set the custom property like this:
span.DefaultStyleSettings.SetPropertyValue(TextMetaInfoProperty, metaInfo);
And read it like this:
var textMeta = span.DefaultStyleSettings.GetPropertyValue(TextMetaInfoProperty);
Any help would be very much appreciated!