using System; using System.Collections.Generic; using System.Windows.Controls; using System.Windows.Data; using InABox.Core; using InABox.WPF; using Microsoft.Xaml.Behaviors; namespace InABox.DynamicGrid; public class DynamicGridTimeStampColumn : DynamicGridMaskColumn where TEntity : BaseObject { protected override Behavior CreateBehaviour() => new TextBoxDateTimeMaskBehavior(Definition?.Format); protected override IValueConverter CreateConverter() => new DateTimeToStringConverter(Definition?.Format); protected override Button[] CreateButtons(TextBox textbox) { var button = new Button(); button.Content = "x"; button.Width = 25; button.Click += (sender, args) => textbox.Text = ""; return new Button[] { button }; } public DynamicGridTimeStampColumn(DynamicGridColumn definition) : base(definition) { } }