/// <summary> /// When overridden in a derived class, gets a read-only element that is bound to the <see cref="P:System.Windows.Controls.DataGridBoundColumn.Binding" /> property value of the column. /// </summary> /// <param name="cell">The cell that will contain the generated element.</param> /// <param name="dataItem">The data item that is represented by the row that contains the intended cell.</param> /// <returns> /// A new read-only element that is bound to the <see cref="P:System.Windows.Controls.DataGridBoundColumn.Binding" /> property value of the column. /// </returns> protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem) { Elysium.Controls.ProgressBar progressBar = new Elysium.Controls.ProgressBar() { DataContext = dataItem }; this.ApplyStyle(false, false, progressBar); this.ApplyBinding(this.LargeChange, progressBar, Elysium.Controls.ProgressBar.LargeChangeProperty); this.ApplyBinding(this.Minimum, progressBar, Elysium.Controls.ProgressBar.MinimumProperty); this.ApplyBinding(this.Maximum, progressBar, Elysium.Controls.ProgressBar.MaximumProperty); this.ApplyBinding(this.SmallChange, progressBar, Elysium.Controls.ProgressBar.SmallChangeProperty); this.ApplyBinding(this.State, progressBar, Elysium.Controls.ProgressBar.StateProperty); this.ApplyBinding(progressBar, Elysium.Controls.ProgressBar.ValueProperty); DataGridColumnToolTipHelper.SetToolTip(cell, this.ToolTip, this.ToolTipTemplate, dataItem); return(progressBar); }
/// <summary> /// When overridden in a derived class, gets a read-only element that is bound to the <see cref="P:System.Windows.Controls.DataGridBoundColumn.Binding" /> property value of the column. /// </summary> /// <param name="cell">The cell that will contain the generated element.</param> /// <param name="dataItem">The data item that is represented by the row that contains the intended cell.</param> /// <returns> /// A new read-only element that is bound to the <see cref="P:System.Windows.Controls.DataGridBoundColumn.Binding" /> property value of the column. /// </returns> protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem) { Elysium.Controls.ProgressBar progressBar = new Elysium.Controls.ProgressBar() { DataContext = dataItem }; this.ApplyStyle(false, false, progressBar); this.ApplyBinding(this.LargeChange, progressBar, Elysium.Controls.ProgressBar.LargeChangeProperty); this.ApplyBinding(this.Minimum, progressBar, Elysium.Controls.ProgressBar.MinimumProperty); this.ApplyBinding(this.Maximum, progressBar, Elysium.Controls.ProgressBar.MaximumProperty); this.ApplyBinding(this.SmallChange, progressBar, Elysium.Controls.ProgressBar.SmallChangeProperty); this.ApplyBinding(this.State, progressBar, Elysium.Controls.ProgressBar.StateProperty); this.ApplyBinding(progressBar, Elysium.Controls.ProgressBar.ValueProperty); DataGridColumnToolTipHelper.SetToolTip(cell, this.ToolTip, this.ToolTipTemplate, dataItem); return progressBar; }