Best way to bind WPF properties to ApplicationSettings in C#?

后端 未结 7 706
野的像风
野的像风 2020-12-07 15:40

What is the best way to bind WPF properties to ApplicationSettings in C#? Is there an automatic way like in a Windows Forms Application? Similar to this question, how (and

相关标签:
7条回答
  • 2020-12-07 16:34

    I like to do it through the ViewModel and just do the binding as normal in the XAML

        public Boolean Value
        {
            get
            {
                return Settings.Default.Value;
    
            }
            set
            {
                Settings.Default.SomeValue= value;
                Settings.Default.Save();
                Notify("SomeValue");
            }
        }
    
    0 讨论(0)
提交回复
热议问题