123456789101112131415161718192021222324252627282930 |
- using System.Windows.Controls;
- using System.Windows.Data;
- using InABox.Core;
- using InABox.WPF;
- using Microsoft.Xaml.Behaviors;
- namespace InABox.DynamicGrid;
- public class DynamicGridDateColumn<TEntity> : DynamicGridMaskColumn<TEntity,DateEditor>
- where TEntity : BaseObject
- {
- protected override Behavior CreateBehaviour() =>
- new TextBoxDateMaskBehavior(Definition?.Format);
- protected override IValueConverter CreateConverter() =>
- new DateToStringConverter(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 DynamicGridDateColumn(DynamicGridColumn definition) : base(definition)
- {
- }
- }
|