Answer the question
In order to leave comments, you need to log in
Why does ListView's SelectedItem fire only once, while SelectedIndex always fires?
view:
<ListView ItemsSource="{Binding Items}"
SelectedItem="{Binding SelectedItem}"
SelectedIndex="{Binding SelectedIndex}"/>
public MyTestModel SelectedItem
{
get => selected;
set
{
selected = value;
Debug.WriteLine("SelectedItem");
RaisePropertyChanged();
}
}
public int SelectedIndex
{
get => index;
set
{
index = value;
Debug.WriteLine("SelectedIndex");
RaisePropertyChanged();
}
}
SelectedItem
SelectedIndex
SelectedIndex
SelectedIndex
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question