Ejemplo n.º 1
0
        protected virtual void OnSelectedItemChanged(DependencyObject oldValue, DependencyObject newValue)
        {
            if (_skipChangedSuspender.IsSuspended)
            {
                return;
            }

            if (oldValue != null)
            {
                SelectableBehavior.SetIsSelectedInt(oldValue, false);
            }

            if (newValue != null)
            {
                SelectableBehavior.SetIsSelectedInt(newValue, true);
            }

            SelectedItemChanged?.Invoke(this, new SelectedItemChangedEventArgs(oldValue, newValue));
        }
Ejemplo n.º 2
0
 public override object ProvideValue(IServiceProvider serviceProvider)
 {
     return(SelectableBehavior.GetOrCreateSelectionScopeByKey(Key));
 }