Several (newbie) questions:
1) I see a lot of
public Person SelectedPerson { get; set; }
I am assuming this does NOT fire a property change?
So, if I want to do so, I must provide the following?
private Person selectedPerson;
public Person SelectedPerson
{
get
{
return this.selectedPerson;
}
set
{
if ((this.selectedPerson != value))
{
this.selectedPerson = value;
base.OnPropertyChanged("SelectedPerson");
// Note: Using ViewModelBase
}
}
}
2) If I have the following:
public bool CanDeletePerson
{
get
{
return SelectedPerson != null;
}
}
and also in the XAML
< Button IsEnabled="{Binding CanDeletePerson}"
Command="{Binding DeletePersonCommand}"> Delete </ Button >
How do I get it to re-evaluate the CanDeletePerson property? Basically, it is initially disabled, but when I click on the grid and move row to row, the SelectedPerson IS being updated, but the CanDeletePerson is NOT getting the updated value, so how do I get it to actually check the value again?
3) I see
... depends on whether anything has subscribed to the event
How do you subscribe to the event?