This is a migrated thread and some comments may be shown as answers.

Multiple Updates Occur when Xaml Binding CurrentItem

1 Answer 10 Views
CollectionNavigator
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 31 Oct 2018, 02:15 AM

I'm using the RadCollectionNavigator in a WPF UserControl.  

 

The CurrentItem Is Bound, TwoWay to a DataContext property.

 

Everytime I navigate using the RCN's navigation buttons the CurrentItem setter is called 3 times.

 

I using ReferenceEquals() to ignore additional calls to the setter with the same value but this causes other problems.

 

Will I need to override the built in navigation buttons to eliminate this behavior?

 

<telerik:RadCollectionNavigator Source="{Binding EvidenceItems}" CurrentItem="{Binding CurrentNavItem, Mode=TwoWay}"/>

 

private EvidenceGridData _CurrentNavItem;
        public object CurrentNavItem
        {
            get { return _CurrentNavItem; }
            set
            {
                if (ReferenceEquals(_CurrentNavItem, value))
                    return;

                _CurrentNavItem = value as EvidenceGridData;
                RaisePropertyChanged(nameof(CurrentNavItem));
            }
        }

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 02 Nov 2018, 11:50 AM
Hi Shawn,

Thank you for the detailed description of the case.

This behavior is due to the by-design behavior of the control. When navigating the CurrentItem is being set on MoveDown/MoveUp, CurrentIndexChanged and CurrentItemChanged. I am afraid that I cannot propose a workaround for this behavior. Can you please share some details on the problems you experience that you mentioned?

Regards,
Stefan
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
CollectionNavigator
Asked by
Shawn
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or