Is it possible to set the text as a link and when a user clicks on link I can run a routine?
Yes, this is possible with a custom template for the editor. You can find the default style for the XamTextEditor in the DefaultStyles\Editors\EditorsGeneric_Express.xaml and add Hyperlink as a content of the TextBlock that is used in the Template. Probably you will have to use some of the events on the hyperlink or disable edit mode of the grid because when you click the editor will enter edit mode by default.
Let me know if you have any questions or concerns.
Also, I set theme properity to [current] when I use style and change theme the control stays the same theme. Is there a way to add hyperlink and keep the ability to change theme?
Should I create a class and inherit XamTextEditor and set hyperlink in the custom class and will that retain theme features?
Thanks
Rick,
From your description everything looks fine with the theme. This code should work:
<igEditors:XamTextEditor x:Name="xamTextEditor1" Theme="[current]" Style="{DynamicResource someStyle/>
public Window1(){ InitializeComponent(); ThemeManager.CurrentTheme = "LunaOlive";}
For more details about common issues with the themes you can find this article helpfull.
Regarding the Hyperlink there are couple of things you shoud be aware - the default navigation will work when the control is placed in a Page. For a Window you can handle RequestNavigate event e.g.
private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e){ System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(e.Uri.AbsoluteUri)); e.Handled = true;}
You can also use the same method with some of the default mouse events of the editor like PreviewMouseLeft ButtonDown.
Is there any particular reason to use the XamTextEditor rather then the standard TextBlock?
The reason I am using XamTextEditor rather than TextBlock is for the theme capabilities.
But when I set the Style on the XamTextEditor it does not theme. All other XamTextEditors do (no style applied to them).
Rick