I created a WPF application in c# with 3 different windows, Home.xaml, Name.xaml, Config.xam
l. I want to declare a variable in Home.xaml.cs
that I
You can use a static property:
public static class ConfigClass()
{
public static int MyProperty { get; set; }
}
Edit:
The idea here is create a class that you holds all "common data", typically configurations. Of course, you can use any class but suggest you to use a static class. You can access this property like this:
Console.Write(ConfigClass.MyProperty)