MarkdownTextBlock Parsing Failed
While moving the common Properties that i use for MarkdownTextBlock to Page.Resources, I noticed that if I use the Property in Setter for TargetType MarkdowmTextBlock, It throws a Xaml Parsing failed error.
I have also uploaded a sample Here to replicate the problem.
ping @deltakosh
ping @deltakosh @nmetulev I dug a few more steps and found out it throws an error Key/Name Not found when i set a style to MarkdownTextBlock.
Thanks a lot @avknaidu I'll check it tomorrow
Sorry I'm a bit swamped out in Build preparation. Will get back to you this thursday Sorry for the delay
@deltakosh no problem. Can you point me to where this issue can be? I always worked on Using and Reusing Controls but never worked on creating new controls. If you can point me where to start by a quick guess, maybe i can debug through and find a fix myself. If i find it, I will make sure I post it here. This is not a show stopper for me, but i can make this into a learning experience for myself.
Did you check that the name space is well defined in you app.xaml?
If it was working in page I think more about a typo or something along this line
Ok. I narrowed it down to ImageStretch Property. if i have this property in Style under Page.Resources, It throws exception. If i remove it, it works fine. Also This is not the only dependancy property that I used in style. I have LinkForeground and it still works perfectly fine.
I think i fixed the problem.
I looked into the Dependency Property Itself and noticed that name of ImageStretchProperty is IsTextSelectionEnabled
public static readonly DependencyProperty ImageStretchProperty = DependencyProperty.Register(
nameof(IsTextSelectionEnabled),
typeof(Stretch),
typeof(MarkdownTextBlock),
new PropertyMetadata(Stretch.None, OnPropertyChangedStatic));
I changed this to ImageStretch and it works fine.
Good catch:) fancy doing a PR?
Sure.