Hello
everyone!
I’ve
created two RadListView on a MasterDetailPage (Xamarin Forms), one on master
(side menu) and another on detail page. When I select an item on master, I
expect a visible selection on detail item. Both lists have the same items, so
that’s the reason that I want to synchronize them.
My problem
is when I tap an Item on master’s list, I can’t mirror the selection
(selectedItem) on Detail’s list. I expect a visible selection on detail item,
once I tap the correspondent on master. If I tap an item on detail, it’s
visibly selected. If I tap again on the same item, it’s unselected, and these
behaviors are ok.
I tried
using the article’s solution below, but the behavior that I want is to keep the
item selected once I tap the item on master.
http://www.telerik.com/forums/how-to-deselect-radlistview-item
Let me show
some code… The binding was made at code-behind, in the ViewModel:
this.SetBinding<IMenuPageViewModel>(DepententListView.SelectedItemProperty, vm =>
vm.SelectedDependent, BindingMode.TwoWay);
This one is the Property's ViewModel:
public IUser SelectedDependent
{
get { return _selectedDependent; }
set
{
if (_selectedDependent != value)
{
_selectedDependent = value;
RaisePropertyChanged();
}
}
}
}
And this one is the
method that I try to change the selection:
public void ChangeDependent(IUser dependent)
{
// I expect the item
selection change here...
this.SelectedDependent = dependent;
// Trying force change...
RaisePropertyChanged("SelectedDependent");
}
In the beginning, I
thought the RadListView had a bug, but I send this to clarify if in fact is. In
Xamarin.Forms’ ListView works fine.
Can anyone help me
with this issue?
Thanks!