Esempio n. 1
0
        private void CustomStackLayoutRenderer_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var pointerPoint = e.GetCurrentPoint(this);

            point.Y = pointerPoint.Position.Y;
            point.X = pointerPoint.Position.X;
            var rowColumnIndex = SfDataGridHelpers.PointToCellRowColumnIndex(grid, point);
            var model          = (GridModel)grid.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name.Equals("GridModel")).GetValue(grid);

            if (previousIndex == rowColumnIndex.RowIndex)
            {
                rowdata = SfDataGridHelpers.GetRowGenerator(grid).Items.FirstOrDefault(x => x.RowIndex == rowColumnIndex.RowIndex);
                if (rowdata != null)
                {
                    wholeRowElement = (VirtualizingCellsControl)rowdata.GetType().GetRuntimeFields().FirstOrDefault(x => x.Name.Equals("WholeRowElement")).GetValue(rowdata);
                    wholeRowElement.BackgroundColor = Xamarin.Forms.Color.Red;
                }
            }
            else
            {
                rowdata = SfDataGridHelpers.GetRowGenerator(grid).Items.FirstOrDefault(x => x.RowIndex == previousIndex);
                if (rowdata != null)
                {
                    wholeRowElement = (VirtualizingCellsControl)rowdata.GetType().GetRuntimeFields().FirstOrDefault(x => x.Name.Equals("WholeRowElement")).GetValue(rowdata);
                    wholeRowElement.BackgroundColor = Xamarin.Forms.Color.White;
                }
            }
            previousIndex = rowColumnIndex.RowIndex;
        }
Esempio n. 2
0
 protected override void SetSelectionAnimation(VirtualizingCellsControl rowElement)
 {
     rowElement.Alpha = 0.5f;
     rowElement.Animate().Alpha(0.5f).SetDuration(1000).AlphaBy(1f).WithEndAction(new Java.Lang.Runnable(() =>
     {
         try
         {
             rowElement.Alpha = 1f;
         }
         catch { }
     }));
 }
        private void InitDefaultProperties(TextBox textBox, GridRenderStyleInfo style)
        {
            Thickness margins = style.TextMargins.ToThickness();

            // TextBoxView always has a minimum margin of 2 for left and right.
            // Margin is hardcoded below so that TextBox behavior is properly emulated.
            margins.Left  = Math.Max(0, margins.Left - 2);
            margins.Right = Math.Max(0, margins.Right - 2);

            textBox.Padding         = margins;
            textBox.BorderThickness = new Thickness(0);
            VirtualizingCellsControl.SetWantsMouseInput(textBox, true);

            textBox.Text = GetControlText(style);
        }
Esempio n. 4
0
 private void Grid_GridTapped(object sender, GridTappedEventArgs e)
 {
     wholeRowElement = (VirtualizingCellsControl)rowdata.GetType().GetRuntimeFields().FirstOrDefault(x => x.Name.Equals("WholeRowElement")).GetValue(rowdata);
     wholeRowElement.BackgroundColor = Xamarin.Forms.Color.Blue;
 }