Esempio n. 1
0
 protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
 {
     ParentTableView.FocusedRowChanged(this);
     base.OnMouseLeftButtonDown(e);
     this.Focus();
     OnFocusLe();
 }
Esempio n. 2
0
 protected override void OnTouchDown(TouchEventArgs e)
 {
     ParentTableView.FocusedRowChanged(this);
     base.OnTouchDown(e);
     this.Focus();
     OnFocusLe();
 }
Esempio n. 3
0
 internal void Select()
 {
     ParentTableView.FocusedRowChanged(this);
     IsSelected = true;
 }
Esempio n. 4
0
        private void OnFocusLe()
        {
            isMouseLeftDown = 2;
            if (ParentTableView.RowClickMode == AyTableView.RowClickModes.RowEdit)
            {
                if (ParentTableView.SelectedCellsPresenter != null)
                {
                    ParentTableView.SelectedCellsPresenter.IsEdit = false;
                }
                IsEdit = true;
            }
            else if (ParentTableView.RowClickMode == AyTableView.RowClickModes.RowDetail && ccDetail.IsNotNull())
            {
                if (ParentTableView.SelectedCellsPresenter != null)
                {
                    if (ParentTableView.SelectedCellsPresenter == this)
                    {
                        HasRowDetail = !HasRowDetail;
                        //ParentTableView.SelectedCellsPresenter.ccDetail.Visibility = ParentTableView.SelectedCellsPresenter.ccDetail.Visibility==Visibility.Collapsed? Visibility.Visible: Visibility.Collapsed;
                    }
                    else
                    {
                        ParentTableView.SelectedCellsPresenter.HasRowDetail = false;
                        //ParentTableView.SelectedCellsPresenter.ccDetail.Visibility = Visibility.Collapsed;
                        HasRowDetail = true;
                        //ccDetail.Visibility = Visibility.Visible;
                    }
                }
                else
                {
                    HasRowDetail = true;
                }
            }
            if (ParentTableView.SelectionMode == AyTableViewSelectionMode.Single || ParentTableView.SelectionMode == AyTableViewSelectionMode.RowTenSingle)
            {
                ParentTableView.FocusedRowChanged(this);
                IsSelected = true;

                if (ParentTableView.SelectedItem != Item)
                {
                    ParentTableView.SelectedItem = Item;
                    ParentTableView.RaiseSelectionChanged(Item);
                }
                else
                {
                    ParentTableView.SelectedItem = Item;
                }
            }
            else if (ParentTableView.SelectionMode == AyTableViewSelectionMode.Multiple)
            {
                ParentTableView.FocusedRowChanged(this);
                IsSelected = !IsSelected;
                if (IsSelected)
                {
                    ParentTableView.SelectedItems.Add(Item);
                    ParentTableView.RaiseOnMultipleSelectionAdd(Item);
                }
                else
                {
                    ParentTableView.SelectedItems.Remove(Item);
                    ParentTableView.RaiseOnMultipleSelectionRemove(Item);
                }
            }
            isMouseLeftDown = 1;
        }
Esempio n. 5
0
 protected override void OnGotFocus(RoutedEventArgs e)
 {
     base.OnGotFocus(e);
     ParentTableView.FocusedRowChanged(this);
     IsSelected = true;
 }