2
votes

I have xaml directly stored in database. Mostly they contain hyperlinks and textblocks. How do i load this in xaml such that the controls are instantiated and seen properly. If i bind it directly to textblock the text will be seen as it is (i.e the xaml won't get instantiated). One approach is to use richtextbox and it would work fine. However, i want a label type of control and not a textbox.

Thanks in advance :)

1

1 Answers

4
votes

A good approach here is to use XamlReader.Load() (Silverlight) or XamlReader.Parse() (WPF) which parses a string and returns an element corresponding to the root of the XAML document.

XamlReader.Load Method (String)

XamlReader.Parse Method (String)