protected override void OnPointerPressed(PointerRoutedEventArgs e)
        {
            if (SelectionModel != null)
            {
                if (e.KeyModifiers.HasFlag(VirtualKeyModifiers.Shift) && !SelectionModel.SingleSelect)
                {
                    if (e.KeyModifiers.HasFlag(VirtualKeyModifiers.Control))
                    {
                        SelectionModel.DeselectRangeFromAnchor(RepeatedIndex);
                    }
                    else
                    {
                        SelectionModel.SelectRangeFromAnchor(RepeatedIndex);
                    }
                }
                else if (e.KeyModifiers.HasFlag(VirtualKeyModifiers.Control))
                {
                    if (SelectionModel.IsSelected(RepeatedIndex).Value)
                    {
                        SelectionModel.Deselect(RepeatedIndex);
                    }
                    else
                    {
                        SelectionModel.Select(RepeatedIndex);
                    }
                }
                else
                {
                    SelectionModel.Select(RepeatedIndex);
                    this.Focus(FocusState.Keyboard);
                }
            }

            base.OnPointerPressed(e);
        }
Пример #2
0
 private void Select(SelectionModel manager, int groupIndex, int itemIndex, bool select)
 {
     Log.Comment((select ? "Selecting " : "DeSelecting ") + groupIndex + "." + itemIndex);
     if (select)
     {
         manager.Select(groupIndex, itemIndex);
     }
     else
     {
         manager.Deselect(groupIndex, itemIndex);
     }
 }
Пример #3
0
 private void Select(SelectionModel manager, int index, bool select)
 {
     Log.Comment((select ? "Selecting " : "DeSelecting ") + index);
     if (select)
     {
         manager.Select(index);
     }
     else
     {
         manager.Deselect(index);
     }
 }
Пример #4
0
 public void Deselect()
 {
     SelectionModel.Deselect(GetGroupIndex(), RepeatedIndex);
 }