I got a "settings" class (in a ownmade subfolder "etc" (in Visual studio)) it has a Boolean propertie named "boobackcolorred"(value = TRUE in the first form it puts it to true). Now I am making a WPF window for my settings and I want to use a checkbox where you can change the value of the boalean. I want to do this in the "XAML" way.(I can do it by making the event checked & unchecked but I don t want to do it that way.)
settings.cs: (in the "etc" folder I created in VS)
class settings
{
public static Boolean boobackcolorred{ get; set; }
... // some extra code that does nothing with this, some xml reading and saving but doesn t matter for this issue.
}
Now I am trying to do this with this xaml checkbox
<CheckBox Content="Red Background?" Name="chbbackgroundred" IsChecked="{Binding etc.settings.boobackcolorred,Mode=TwoWay}" ></CheckBox>
OFC this isn t going to work I tried many ways of getting this to work. tried to include stuff like this:
xmlns:settings="clr-namespace:etc.myapp.settings"
also tried to bind the datacontext of the grid where the checkbox is in but no luck.
I know this can t be hard. However the answer will be greatly appreciated.
PS: it should be twoway binded so if unchecked the static boolean becomes false.