In my WPF app, I have a class with Static strings as follows and I refer the same from the XAML. My intention is to update these static strings and the UI texts should reflect the update.
public class StaticStrings
{
public static string text1= "sample 1";
public static string text2= "sample 2";
public static string text3= "sample 3";
}
From the XAML I refer them as below:
<Label
Content="{x:Static local:StaticStrings.text1}"
Background="Transparent"
Margin="5,0,18,3"
/>
<Button x:Name="btn"
Click="btn_MouseUp"
ToolTip="{x:Static local:StaticStrings.text2}"
/>
During runtime, I would update the texts of StaticStrings
and wish to see them reflected in the UI. How to achieve this?