12345678910111213141516171819202122232425262728293031 |
- 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<TEntity> : DynamicGridMaskColumn<TEntity,DateTimeEditor> 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)
- {
- }
- }
|