lundi 29 août 2016

WPF MVVM CheckBoxes

I'm pretty new to the MVVM style of programming. The problem I am having is, I'm trying to set the property of a checkbox when the wpf window loads. I do not need the property to be able to be changed. I merely need to show that it is checked or not.

XAML:

<CheckBox x:Name="UpdateClosingCostAutoResult"  Grid.Column="1" IsHitTestVisible="False" Focusable="False" IsChecked="{Binding IsSelected}" />

ViewModel:

private bool _isSelected = true; public bool IsSelected { get { return _isSelected; } set { SetProperty(ref _isSelected, value); } }

Not entirely sure if the ViewModel is correct or even remotely going in the right direction.




Aucun commentaire:

Enregistrer un commentaire