How to set a String ViewModel property on ReadioButton Check usin WPF?
I am new to WPF and here I am trying to set a simple string property of my
viewModel when a particular radio button is checked on my window.
class ViewModel
{
string LanguageSettings
}
XAML looks like following:
<RadioButton Name="OptionEnglish" GroupName="LanguageOptions"
IsChecked="{Binding LanguageSettings}" Content="English"
HorizontalAlignment="Right" Width="760" />
<RadioButton Name="OptionChinese" GroupName="LanguageOptions"
IsChecked="{Binding LanguageSettings}" Content="Chinese" />
All I want here is that when English is selected I want Language Settings
to be set as English and same for Chinese. Is there any simple way to do
it? I also looked into some IValueConverter examples. Do I really need to
do that? is there any straightforward way to set that property?
No comments:
Post a Comment