Does anyone have any idea how I could create, let’s say, a public static RichTextBox in XAML? It’s easy if I declare it in code:
public static RichTextBox r;
But how about in XAML? It seems like it should be possible but I couldn’t manage to do it with:
<RichTextBox x:Name="convBox" Margin="29.333,26,39.333,95" VerticalScrollBarVisibility="Visible">
Is it possible to make it public and static from XAML?
Thanks!
You can define it as a resource in App.xaml. Static variables are really just global variables and resources defined in App.xaml are really just globals also. There are various differences of course. I’m not sure what this would achieve with a rich text box but does answer your question in a fashion.