Inheritance: DependencyObject
Esempio n. 1
0
        // Token: 0x06005CA3 RID: 23715 RVA: 0x001A1044 File Offset: 0x0019F244
        private static void OnIsVirtualizingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DataGridCellsPresenter dataGridCellsPresenter = (DataGridCellsPresenter)d;

            DataGridHelper.TransferProperty(dataGridCellsPresenter, VirtualizingPanel.IsVirtualizingProperty);
            if (e.OldValue != dataGridCellsPresenter.GetValue(VirtualizingPanel.IsVirtualizingProperty))
            {
                dataGridCellsPresenter.InvalidateDataGridCellsPanelMeasureAndArrange();
            }
        }
Esempio n. 2
0
 // Token: 0x06005D34 RID: 23860 RVA: 0x001A3CA8 File Offset: 0x001A1EA8
 internal void SyncProperties()
 {
     DataGridHelper.TransferProperty(this, ContentControl.ContentProperty);
     DataGridHelper.TransferProperty(this, FrameworkElement.StyleProperty);
     DataGridHelper.TransferProperty(this, ContentControl.ContentTemplateProperty);
     DataGridHelper.TransferProperty(this, ContentControl.ContentTemplateSelectorProperty);
     DataGridHelper.TransferProperty(this, FrameworkElement.WidthProperty);
     base.CoerceValue(DataGridRowHeader.IsRowSelectedProperty);
     this.OnCanUserResizeRowsChanged();
 }
        /// <summary>
        ///     General notification for DependencyProperty changes from the grid or from columns.
        /// </summary>
        internal void NotifyPropertyChanged(DependencyObject d, string propertyName, DependencyPropertyChangedEventArgs e, NotificationTarget target)
        {
            if (DataGridHelper.ShouldNotifyCellsPresenter(target))
            {
                if (e.Property == DataGridColumn.WidthProperty ||
                    e.Property == DataGridColumn.DisplayIndexProperty)
                {
                    if (((DataGridColumn)d).IsVisible)
                    {
                        InvalidateDataGridCellsPanelMeasureAndArrange();
                    }
                }
                else if (e.Property == DataGrid.FrozenColumnCountProperty ||
                         e.Property == DataGridColumn.VisibilityProperty ||
                         e.Property == DataGrid.CellsPanelHorizontalOffsetProperty ||
                         e.Property == DataGrid.HorizontalScrollOffsetProperty ||
                         string.Compare(propertyName, "ViewportWidth", StringComparison.Ordinal) == 0 ||
                         string.Compare(propertyName, "DelayedColumnWidthComputation", StringComparison.Ordinal) == 0)
                {
                    InvalidateDataGridCellsPanelMeasureAndArrange();
                }
                else if (string.Compare(propertyName, "RealizedColumnsBlockListForNonVirtualizedRows", StringComparison.Ordinal) == 0)
                {
                    InvalidateDataGridCellsPanelMeasureAndArrange(/* withColumnVirtualization */ false);
                }
                else if (string.Compare(propertyName, "RealizedColumnsBlockListForVirtualizedRows", StringComparison.Ordinal) == 0)
                {
                    InvalidateDataGridCellsPanelMeasureAndArrange(/* withColumnVirtualization */ true);
                }
                else if (e.Property == DataGrid.RowHeightProperty || e.Property == HeightProperty)
                {
                    DataGridHelper.TransferProperty(this, HeightProperty);
                }
                else if (e.Property == DataGrid.MinRowHeightProperty || e.Property == MinHeightProperty)
                {
                    DataGridHelper.TransferProperty(this, MinHeightProperty);
                }
                else if (e.Property == DataGrid.EnableColumnVirtualizationProperty)
                {
                    DataGridHelper.TransferProperty(this, VirtualizingStackPanel.IsVirtualizingProperty);
                }
            }

            if (DataGridHelper.ShouldNotifyCells(target) ||
                DataGridHelper.ShouldRefreshCellContent(target))
            {
                ContainerTracking <DataGridCell> tracker = _cellTrackingRoot;
                while (tracker != null)
                {
                    tracker.Container.NotifyPropertyChanged(d, propertyName, e, target);
                    tracker = tracker.Next;
                }
            }
        }
        /// <summary>
        ///     Coercion callback for VirtualizingStackPanel.IsVirtualizing property
        /// </summary>
        private static object OnCoerceIsVirtualizingProperty(DependencyObject d, object baseValue)
        {
            var headersPresenter = d as DataGridColumnHeadersPresenter;

            return(DataGridHelper.GetCoercedTransferPropertyValue(
                       headersPresenter,
                       baseValue,
                       VirtualizingPanel.IsVirtualizingProperty,
                       headersPresenter.ParentDataGrid,
                       DataGrid.EnableColumnVirtualizationProperty));
        }
Esempio n. 5
0
        /// <summary>
        ///     Coerces the Width property.
        /// </summary>
        private static object OnCoerceWidth(DependencyObject d, object baseValue)
        {
            var header = d as DataGridRowHeader;

            return(DataGridHelper.GetCoercedTransferPropertyValue(
                       header,
                       baseValue,
                       WidthProperty,
                       header.DataGridOwner,
                       DataGrid.RowHeaderWidthProperty));
        }
Esempio n. 6
0
        private void InitGrid(DataGridView grid)
        {
            grid.AutoGenerateColumns = false;
            grid.ReadOnly            = true;
            grid.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;

            DataGridHelper.AddTextBoxColumn(grid, "UserID", "用户ID", 120);
            DataGridHelper.AddTextBoxColumn(grid, "UserName", "用户名", 120);
            DataGridHelper.AddTextBoxColumn(grid, "FCreateDate", "创建日期", 120);
            DataGridHelper.AddCheckBoxColumn(grid, "IsStop", "停用", 80).ReadOnly = true;
        }
        /// <summary>
        ///     Coerces the ContentStringFormat property based on the templates defined on the Column.
        /// </summary>
        private static object OnCoerceStringFormat(DependencyObject d, object baseValue)
        {
            var columnHeader = d as DataGridColumnHeader;

            return(DataGridHelper.GetCoercedTransferPropertyValue(
                       columnHeader,
                       baseValue,
                       ContentStringFormatProperty,
                       columnHeader.Column,
                       DataGridColumn.HeaderStringFormatProperty));
        }
Esempio n. 8
0
        private void InitGrid(DataGridView grid)
        {
            grid.ReadOnly           = true;
            grid.AllowUserToAddRows = false;

            var col = DataGridHelper.AddTextBoxColumn(grid, "UserID", "用户ID");

            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;

            DataGridHelper.AddTextBoxColumn(grid, "UserName", "用户名");
        }
        /// <summary>
        ///     Coerces the ContentTemplateSelector property based on the selector defined on the Column.
        /// </summary>
        private static object OnCoerceContentTemplateSelector(DependencyObject d, object baseValue)
        {
            var columnHeader = d as DataGridColumnHeader;

            return(DataGridHelper.GetCoercedTransferPropertyValue(
                       columnHeader,
                       baseValue,
                       ContentTemplateSelectorProperty,
                       columnHeader.Column,
                       DataGridColumn.HeaderTemplateSelectorProperty));
        }
        /// <summary>
        ///     Coercion callback for VirtualizingStackPanel.IsVirtualizing property
        /// </summary>
        private static object OnCoerceIsVirtualizingProperty(DependencyObject d, object baseValue)
        {
            var cellsPresenter = d as DataGridCellsPresenter;

            return(DataGridHelper.GetCoercedTransferPropertyValue(
                       cellsPresenter,
                       baseValue,
                       VirtualizingStackPanel.IsVirtualizingProperty,
                       cellsPresenter.DataGridOwner,
                       DataGrid.EnableColumnVirtualizationProperty));
        }
        private static object OnCoerceMinHeight(DependencyObject d, object baseValue)
        {
            var cellsPresenter = d as DataGridCellsPresenter;

            return(DataGridHelper.GetCoercedTransferPropertyValue(
                       cellsPresenter,
                       baseValue,
                       MinHeightProperty,
                       cellsPresenter.DataGridOwner,
                       DataGrid.MinRowHeightProperty));
        }
Esempio n. 12
0
 // Token: 0x06005D36 RID: 23862 RVA: 0x001A3D0C File Offset: 0x001A1F0C
 internal void NotifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     if (e.Property == DataGridRow.HeaderProperty || e.Property == ContentControl.ContentProperty)
     {
         DataGridHelper.TransferProperty(this, ContentControl.ContentProperty);
         return;
     }
     if (e.Property == DataGrid.RowHeaderStyleProperty || e.Property == DataGridRow.HeaderStyleProperty || e.Property == FrameworkElement.StyleProperty)
     {
         DataGridHelper.TransferProperty(this, FrameworkElement.StyleProperty);
         return;
     }
     if (e.Property == DataGrid.RowHeaderTemplateProperty || e.Property == DataGridRow.HeaderTemplateProperty || e.Property == ContentControl.ContentTemplateProperty)
     {
         DataGridHelper.TransferProperty(this, ContentControl.ContentTemplateProperty);
         return;
     }
     if (e.Property == DataGrid.RowHeaderTemplateSelectorProperty || e.Property == DataGridRow.HeaderTemplateSelectorProperty || e.Property == ContentControl.ContentTemplateSelectorProperty)
     {
         DataGridHelper.TransferProperty(this, ContentControl.ContentTemplateSelectorProperty);
         return;
     }
     if (e.Property == DataGrid.RowHeaderWidthProperty || e.Property == FrameworkElement.WidthProperty)
     {
         DataGridHelper.TransferProperty(this, FrameworkElement.WidthProperty);
         return;
     }
     if (e.Property == DataGridRow.IsSelectedProperty)
     {
         base.CoerceValue(DataGridRowHeader.IsRowSelectedProperty);
         return;
     }
     if (e.Property == DataGrid.CanUserResizeRowsProperty)
     {
         this.OnCanUserResizeRowsChanged();
         return;
     }
     if (e.Property == DataGrid.RowHeaderActualWidthProperty)
     {
         base.InvalidateMeasure();
         base.InvalidateArrange();
         UIElement uielement = base.Parent as UIElement;
         if (uielement != null)
         {
             uielement.InvalidateMeasure();
             uielement.InvalidateArrange();
             return;
         }
     }
     else if (e.Property == DataGrid.CurrentItemProperty || e.Property == DataGridRow.IsEditingProperty || e.Property == UIElement.IsMouseOverProperty || e.Property == UIElement.IsKeyboardFocusWithinProperty)
     {
         base.UpdateVisualState();
     }
 }
Esempio n. 13
0
        /// <summary>
        ///     Coerces the Content property.  We're choosing a value between Row.Header and the Content property on RowHeader.
        /// </summary>
        private static object OnCoerceContent(DependencyObject d, object baseValue)
        {
            var header = d as DataGridRowHeader;

            return(DataGridHelper.GetCoercedTransferPropertyValue(
                       header,
                       baseValue,
                       ContentProperty,
                       header.ParentRow,
                       DataGridRow.HeaderProperty));
        }
Esempio n. 14
0
        private void SldHeaderMinHeight_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            if (!IsLoaded)
            {
                return;
            }

            DataGridHelper.SetHeaderMinHeight(DgCustom, SldHeaderMinHeight.Value);

            UpdateCode();
        }
Esempio n. 15
0
 private void btnModificar_Click(object sender, EventArgs e)
 {
     try {
         var idGasto = DataGridHelper.GetIdFromRowCell(dgGastos, "idGasto");
         var form    = CreateFormGasto(idGasto);
         form.Show();
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 16
0
 internal void NotifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     if (e.Property == DataGrid.RowDetailsTemplateProperty || e.Property == DataGridRow.DetailsTemplateProperty || e.Property == ContentTemplateProperty)
     {
         DataGridHelper.TransferProperty(this, ContentTemplateProperty);
     }
     else if (e.Property == DataGrid.RowDetailsTemplateSelectorProperty || e.Property == DataGridRow.DetailsTemplateSelectorProperty || e.Property == ContentTemplateSelectorProperty)
     {
         DataGridHelper.TransferProperty(this, ContentTemplateSelectorProperty);
     }
 }
Esempio n. 17
0
        public static object FilterBy(string filter, string check, string field)
        {
            if (check == "Movies")
            {
                _nestedGrid[] nestedItems = new _nestedGrid[] { _nestedGrid.Movies_Comments };
                string        fieldName   = "Komentarze";


                var filterQuery = Builders <BsonDocument> .Filter.Regex(field, new BsonRegularExpression(filter, "i"));

                var queryResult = _movieCollection
                                  .Aggregate()
                                  .Lookup("Komentarze", "tytul", "Nazwa_filmu", fieldName)
                                  .Match(filterQuery)
                                  .ToList();


                return(DataGridHelper.CreateNestedGrid(queryResult, nestedItems, fieldName));
            }
            else if (check == "Comments")
            {
                _nestedGrid[] nestedItems = new _nestedGrid[] { _nestedGrid.Comments_Users };
                string        fieldName   = "Pokaż dane użytkownika";

                var filterQuery = Builders <BsonDocument> .Filter.Regex(field, new BsonRegularExpression(filter, "i"));

                var queryResult = _movieCollection
                                  .Aggregate()
                                  .Lookup("Użytkownicy", "Email", "Email", fieldName)
                                  .Match(filterQuery)
                                  .ToList();


                return(DataGridHelper.CreateNestedGrid(queryResult, nestedItems, fieldName));
            }
            else if (check == "Users")
            {
                _nestedGrid[] nestedItems = new _nestedGrid[] { _nestedGrid.Users_Comments };
                string        fieldName   = "Wszystkie komentarze użytkownika";

                var filterQuery = Builders <BsonDocument> .Filter.Regex(field, new BsonRegularExpression(filter, "i"));

                var queryResult = _movieCollection
                                  .Aggregate()
                                  .Lookup("Komentarze", "Email", "Email", fieldName)
                                  .Match(filterQuery)
                                  .ToList();


                return(DataGridHelper.CreateNestedGrid(queryResult, nestedItems, fieldName));
            }

            return(0);
        }
Esempio n. 18
0
 public CatalogSearchView()
 {
     InitializeComponent();
     SearchText.KeyDown += (sender, args) => {
         if (args.Key == Key.Return)
         {
             DataGridHelper.Focus(Items);
         }
     };
     ApplyStyles();
 }
Esempio n. 19
0
        protected virtual void InitGridColumn()
        {
            this.sGrid.AutoGenerateColumns = false;

            DataGridHelper.AddTextBoxColumn(sGrid, "cMCode", "模具编码");
            DataGridHelper.AddTextBoxColumn(sGrid, "cMName", "模具名称", 120);
            DataGridHelper.AddTextBoxColumn(sGrid, "cMCCode", "分类编码");
            DataGridHelper.AddTextBoxColumn(sGrid, "cMCName", "分类名称");
            DataGridHelper.AddTextBoxColumn(sGrid, "Points", "穴数");
            DataGridHelper.AddTextBoxColumn(sGrid, "cMaker", "建档人");
            DataGridHelper.AddTextBoxColumn(sGrid, "dCreateDate", "建档日期");
        }
Esempio n. 20
0
        /// <summary>
        ///     Update all properties that get a value from the DataGrid
        /// </summary>
        /// <remarks>
        ///     See comment on DataGridRow.OnDataGridChanged
        /// </remarks>
        internal void SyncProperties()
        {
            DataGridHelper.TransferProperty(this, ContentProperty);
            DataGridHelper.TransferProperty(this, StyleProperty);
            DataGridHelper.TransferProperty(this, ContentTemplateProperty);
            DataGridHelper.TransferProperty(this, ContentTemplateSelectorProperty);
            DataGridHelper.TransferProperty(this, WidthProperty);
            CoerceValue(IsRowSelectedProperty);

            // We could be the first row now, so reset the thumb visibility.
            OnCanUserResizeRowsChanged();
        }
        protected override void OnInitialized(EventArgs args)
        {
            base.OnInitialized(args);

            this.CommandBindings.Add(new CommandBinding(AddNewInitializerCommand, this.OnAddNewInitializerExecuted));

            //create data grid helper
            this.correlationInitializerDGHelper = new DataGridHelper(this.correlationInitializers, this);
            this.correlationInitializerDGHelper.ShowValidationErrorAsToolTip = true;
            this.correlationInitializerDGHelper.AddNewRowContent = (string)this.FindResource("addNewInitializer");
            this.correlationInitializerDGHelper.AddNewRowCommand = CorrelationInitializerDesigner.AddNewInitializerCommand;            
        }
        /// <summary>
        /// Coercion callback for Height property.
        /// </summary>
        private static object OnCoerceHeight(DependencyObject d, object baseValue)
        {
            var      header   = d as DataGridColumnHeader;
            DataGrid dataGrid = header.Column != null ? header.Column.DataGridOwner : null;

            return(DataGridHelper.GetCoercedTransferPropertyValue(
                       header,
                       baseValue,
                       HeightProperty,
                       dataGrid,
                       DataGrid.ColumnHeaderHeightProperty));
        }
Esempio n. 23
0
        // Token: 0x06005CD0 RID: 23760 RVA: 0x001A1E64 File Offset: 0x001A0064
        private static object OnCoerceContent(DependencyObject d, object baseValue)
        {
            DataGridColumnHeader dataGridColumnHeader    = d as DataGridColumnHeader;
            object          coercedTransferPropertyValue = DataGridHelper.GetCoercedTransferPropertyValue(dataGridColumnHeader, baseValue, ContentControl.ContentProperty, dataGridColumnHeader.Column, DataGridColumn.HeaderProperty);
            FrameworkObject frameworkObject = new FrameworkObject(coercedTransferPropertyValue as DependencyObject);

            if (frameworkObject.Parent != null && frameworkObject.Parent != dataGridColumnHeader)
            {
                frameworkObject.ChangeLogicalParent(null);
            }
            return(coercedTransferPropertyValue);
        }
Esempio n. 24
0
 private void FirstTimeLoadedHandler(object sender, RoutedEventArgs e)
 {
     Loaded -= FirstTimeLoadedHandler;  // Ensure that this handler is called only once.
     if (bookTable.Items.Count > 0)
     {
         var firstColumn = bookTable.ColumnFromDisplayIndex(0);
         firstColumn.SortDirection = ListSortDirection.Ascending;
         ViewModel.Sort            = DataGridHelper.GetSorting <BookDataModel>(firstColumn);
         bookTable.SelectedIndex   = 0;
         FocusFirstCell();
     }
 }
Esempio n. 25
0
        /// <summary>
        ///     Notification for column header-related DependencyProperty changes from the grid or from columns.
        /// </summary>
        internal void NotifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.Property == DataGridRow.HeaderProperty || e.Property == ContentProperty)
            {
                DataGridHelper.TransferProperty(this, ContentProperty);
            }
            else if (e.Property == DataGrid.RowHeaderStyleProperty || e.Property == DataGridRow.HeaderStyleProperty || e.Property == StyleProperty)
            {
                DataGridHelper.TransferProperty(this, StyleProperty);
            }
            else if (e.Property == DataGrid.RowHeaderTemplateProperty || e.Property == DataGridRow.HeaderTemplateProperty || e.Property == ContentTemplateProperty)
            {
                DataGridHelper.TransferProperty(this, ContentTemplateProperty);
            }
            else if (e.Property == DataGrid.RowHeaderTemplateSelectorProperty || e.Property == DataGridRow.HeaderTemplateSelectorProperty || e.Property == ContentTemplateSelectorProperty)
            {
                DataGridHelper.TransferProperty(this, ContentTemplateSelectorProperty);
            }
            else if (e.Property == DataGrid.RowHeaderWidthProperty || e.Property == WidthProperty)
            {
                DataGridHelper.TransferProperty(this, WidthProperty);
            }
            else if (e.Property == DataGridRow.IsSelectedProperty)
            {
                CoerceValue(IsRowSelectedProperty);
            }
            else if (e.Property == DataGrid.CanUserResizeRowsProperty)
            {
                OnCanUserResizeRowsChanged();
            }
            else if (e.Property == DataGrid.RowHeaderActualWidthProperty)
            {
                // When the RowHeaderActualWidth changes we need to re-measure to pick up the new value for DesiredSize
                this.InvalidateMeasure();
                this.InvalidateArrange();

                // If the DataGrid has not run layout the headers parent may not position the cells correctly when the header size changes.
                // This will cause the cells to be out of sync with the columns. To avoid this we will force a layout of the headers parent panel.
                var parent = this.Parent as UIElement;
                if (parent != null)
                {
                    parent.InvalidateMeasure();
                    parent.InvalidateArrange();
                }
            }
            else if (e.Property == DataGrid.CurrentItemProperty ||
                     e.Property == DataGridRow.IsEditingProperty ||
                     e.Property == DataGridRow.IsMouseOverProperty ||
                     e.Property == DataGrid.IsKeyboardFocusWithinProperty)
            {
                UpdateVisualState();
            }
        }
        public OrderRejectDetails()
        {
            InitializeComponent();

            Loaded += (sender, args) => {
                ApplyStyles();
            };


            new Editable().Attach(Offers);
            DataGridHelper.CalculateColumnWidths(Offers);
        }
        public MatchedWaybills()
        {
            InitializeComponent();

            DataGridHelper.CalculateColumnWidth(WaybillLines, "99999.99", "Цена производителя без НДС");
            DataGridHelper.CalculateColumnWidth(WaybillLines, "99999.99", "Цена ГР");
            DataGridHelper.CalculateColumnWidth(WaybillLines, "99999.99", "Торговая наценка оптовика");
            DataGridHelper.CalculateColumnWidth(WaybillLines, "99999.99", "Цена поставщика без НДС");
            DataGridHelper.CalculateColumnWidth(WaybillLines, "999", "НДС");
            DataGridHelper.CalculateColumnWidth(WaybillLines, "99999.99", "Цена поставщика с НДС");
            DataGridHelper.CalculateColumnWidth(WaybillLines, "99999.99", "Заказ");
        }
        protected override void OnInitialized(EventArgs args)
        {
            base.OnInitialized(args);

            this.CommandBindings.Add(new CommandBinding(AddNewInitializerCommand, this.OnAddNewInitializerExecuted));

            //create data grid helper
            this.correlationInitializerDGHelper = new DataGridHelper(this.correlationInitializers, this);
            this.correlationInitializerDGHelper.ShowValidationErrorAsToolTip = true;
            this.correlationInitializerDGHelper.AddNewRowContent             = (string)this.FindResource("addNewInitializer");
            this.correlationInitializerDGHelper.AddNewRowCommand             = CorrelationInitializerDesigner.AddNewInitializerCommand;
        }
        private void DataGridLoaded(DataGrid dataGrid, InternalLeagueCode internalLeagueCode, GridType gridType)
        {
            try
            {
                var externalLeagueCode = _leagueDtosSingletonInstance.LeagueDtos.Single(x => x.InternalLeagueCode == internalLeagueCode).ExternalLeagueCode;
                //throw new Exception();//for debugging

                var dataGridEmpty = DataGridHelper.IsDataGridEmpty(dataGrid);

                if (dataGridEmpty)
                {
                    //throw new Exception();//for debugging
                    ThreadedDataProvider threadedDataProvider;

                    switch (gridType)
                    {
                    case GridType.Standing:
                        threadedDataProvider = new ThreadedDataProvider(externalLeagueCode);
                        this.DataContext     = threadedDataProvider;
                        threadedDataProvider.FetchDataFromGateway(externalLeagueCode, GridType.Standing);
                        dataGrid.ItemsSource = threadedDataProvider.LeagueParents.Single(x => x.ExternalLeagueCode == externalLeagueCode).Standings ?? (IEnumerable)_nullStandings;
                        break;

                    case GridType.Result:
                        threadedDataProvider = new ThreadedDataProvider(externalLeagueCode);
                        this.DataContext     = threadedDataProvider;
                        threadedDataProvider.FetchDataFromGateway(externalLeagueCode, GridType.Result);
                        dataGrid.ItemsSource = threadedDataProvider.LeagueParents.Single(x => x.ExternalLeagueCode == externalLeagueCode).FixturePasts ?? (IEnumerable)_nullFixturePasts;
                        break;

                    case GridType.Fixture:
                        threadedDataProvider = new ThreadedDataProvider(externalLeagueCode);
                        this.DataContext     = threadedDataProvider;
                        threadedDataProvider.FetchDataFromGateway(externalLeagueCode, GridType.Fixture);
                        dataGrid.ItemsSource = threadedDataProvider.LeagueParents.Single(x => x.ExternalLeagueCode == externalLeagueCode).FixtureFutures ?? (IEnumerable)_nullFixtureFutures;
                        break;
                    }

                    DataGridHelper.HideHeaderIfNoDataToShow(dataGrid);
                    UpdateLastUpdatedDate(null);
                }
            }
            catch (Exception ex)
            {
                var errorText = $"{EntityConstants.UnexpectedErrorOccured} ({internalLeagueCode}_{gridType})";
                Logger.Log($"{errorText} {ex.Message}");
                dataGrid.ItemsSource = new List <NullReturn> {
                    new NullReturn {
                        PoliteError = errorText
                    }
                };
            }
        }
Esempio n. 30
0
        private void UpdateTemplate()
        {
            var color = Helper.GetColorByOffset(_linearGradientBrush.GradientStops, SldTheme.Value / 7);

            DataGridHelper.SetHoverBackground(DgCustom, new Color()
            {
                A = 34, R = color.R, G = color.G, B = color.B
            }.ToBrush());
            DataGridHelper.SetSelectedBackground(DgCustom, new Color()
            {
                A = 68, R = color.R, G = color.G, B = color.B
            }.ToBrush());
        }
Esempio n. 31
0
 void LoadData()
 {
     try
     {
         c_lst = c_Customer_Controller.Customer_GetAll();
         dgrRenter.ItemsSource = c_lst;
         DataGridHelper.NVSFocus(dgrRenter, 0, 0);
     }
     catch (Exception ex)
     {
         CommonData.log.Error(ex.ToString());
     }
 }
        public CorrelationDataDesigner()
        {
            this.InitializeComponent();

            //create data grid helper
            this.correlationDataDGHelper = new DataGridHelper(this.correlationInitializers, this);            
            //add binding to handle Add new entry clicks
            this.CommandBindings.Add(new CommandBinding(AddNewDataCommand, OnAddNewDataExecuted));
            //provide callback to add new row functionality
            this.correlationDataDGHelper.AddNewRowCommand = AddNewDataCommand;
            //add title for "add new row" button
            this.correlationDataDGHelper.AddNewRowContent = (string)this.FindResource("addNewEntry");                       

            CorrelationDataWrapper.Editor = this;
        }
        public ArgumentDesigner()
        {
            InitializeComponent();

            this.dgHelper = new DataGridHelper(this.argumentsDataGrid, this);
            this.dgHelper.Context = this.Context;
            this.dgHelper.AddNewRowContent = (string)this.FindResource("addNewArgumentTitle");
            this.dgHelper.AddNewRowCommand = DesignerView.CreateArgumentCommand;
            this.dgHelper.ResolveDynamicTemplateCallback = this.OnResolveDynamicContentTemplate;
            this.dgHelper.LoadDynamicContentDataCallback = this.OnShowExtendedValueEditor;
            this.dgHelper.LoadCustomPropertyValueEditorCallback = this.OnLoadExtendedValueEditor;

            this.argumentsDataGrid.SelectionChanged += OnDataGridArgumentSelected;
            this.argumentsDataGrid.GotFocus += OnDataGridArgumentSelected;

            this.argumentWrapperCollection.CollectionChanged += OnArgumentWrapperCollectionChanged;
            this.argumentsDataGrid.ItemsSource = this.argumentWrapperCollection;

            this.argumentsDataGrid.LayoutUpdated += OnArgumentDataGridLayoutUpdated;
        }
        public VariableDesigner()
        {
            InitializeComponent();

            this.dgHelper = new DataGridHelper(this.variableDataGrid, this);
            this.dgHelper.Context = this.Context;
            this.dgHelper.AddNewRowCommand = DesignerView.CreateVariableCommand;
            this.dgHelper.AddNewRowContent = (string)this.FindResource("addVariableNewRowLabel");
            this.dgHelper.ResolveDynamicTemplateCallback = this.OnResolveDynamicContentTemplate;
            this.dgHelper.LoadDynamicContentDataCallback = this.OnShowExtendedValueEditor;
            this.dgHelper.LoadCustomPropertyValueEditorCallback = this.OnLoadExtendedValueEditor;
            this.dgHelper.ShowValidationErrorAsToolTip = false;

            this.variableDataGrid.SelectionChanged += OnDataGridRowSelected;
            this.variableWrapperCollection.CollectionChanged += OnVariableWrapperCollectionChanged;
            this.variableDataGrid.ItemsSource = this.variableWrapperCollection;

            var converter = (BreadCrumbTextConverter)this.FindResource("scopeToNameConverter");
            converter.PixelsPerChar = (this.FontSize - 5);
        }
        public DynamicArgumentDesigner()
        {
            InitializeComponent();

            this.dgHelper = new DataGridHelper(this.WPF_DataGrid, this);
            this.dgHelper.AddNewRowCommand = DynamicArgumentDesigner.CreateDynamicArgumentCommand;
            this.HintText = null;

            this.WPF_DataGrid.LoadingRow += this.DataGrid_Standard_LoadingRow;

            this.Loaded += (sender, e) =>
            {
                OnReadOnlyStateChanged(new ReadOnlyState());
                this.ContextItemManager.Subscribe<ReadOnlyState>(this.OnReadOnlyStateChangedCallback);
                this.OnDynamicArgumentsLoaded();
                this.OnUnderlyingArgumentTypeChanged();
            };
            this.Unloaded += (sender, e) =>
            {
                this.ContextItemManager.Unsubscribe<ReadOnlyState>(this.OnReadOnlyStateChangedCallback);
            };

            DynamicArgumentWrapperObject.Editor = this;
        }
 protected override void OnInitialized(EventArgs e)
 {
     base.OnInitialized(e);
     //create data grid helper and provide drop down with type expander as new row template
     this.messageQueriesDGHelper = new DataGridHelper(this.messageQueries, this);
     this.messageQueriesDGHelper.AddNewRowContent = this.FindResource("newRowTemplate");
     this.messageQueriesDGHelper.ShowValidationErrorAsToolTip = true;
     this.messageQueries.ItemsSource = this.dataSource;
     this.dataSource.CollectionChanged += this.OnDataCollectionChanged;
 }
        protected override void OnInitialized(EventArgs e)
        {
            this.dgHelper = new DataGridHelper(this.typesDataGrid, this);
            this.dgHelper.AddNewRowContent = this.FindResource("addNewRowLabel");
            this.dgHelper.AddNewRowCommand = AddNewTypeCommand;

            base.OnInitialized(e);
        }