using System; using Windows.UI.Xaml; using Windows.UI.Xaml.Data; using Telerik.UI.Xaml.Controls.Grid; using Telerik.UI.Xaml.Controls.Grid.Primitives; namespace NMaxDashboard.App.Views.Controls.PowerNumbers { public class StringNameColumn : DataGridTypedColumn { private static readonly Type InfoType = typeof(StringNameControl); public StringNameColumn() { CanUserEdit = false; CanUserReorder = false; CanUserResize = false; CanUserSort = false; SizeMode = DataGridColumnSizeMode.Auto; } public override object CreateContainer(object rowItem) { return new StringNameControl(); } public override object GetContainerType(object rowItem) { return InfoType; } public override void PrepareCell(object container, object value, object item) { if (container is StringNameControl infoPage && value is (string header, int contextData)) { infoPage.DataContext = contextData; Header = header; } } public override void PrepareEditorContentVisual(FrameworkElement editorContent, Binding binding) { } public override void ClearEditorContentVisual(FrameworkElement editorContent) { } public override FrameworkElement CreateEditorContentVisual() { return null; } public override object GetEditorType(object item) { return null; } protected override DataGridFilterControlBase CreateFilterControl() { return null; } } }