Пример #1
0
        public DatesRangeSelectView(DateTime max, DateTime min, DateSelectionItem selectionItem)
        {
            InitializeComponent();

            dt1.DisplayDateEnd   = dt2.DisplayDateEnd = max;
            dt1.DisplayDateStart = dt2.DisplayDateStart = min;

            dt1.SelectedDate = selectionItem.Start;
            dt2.SelectedDate = selectionItem.End;
        }
Пример #2
0
        public static void Show(Action <DateSelectionItem> selected, DateTime max, DateTime min, DateSelectionItem selectionItem)
        {
            var control = new DatesRangeSelectView(max, min, selectionItem);
            var dialog  = new DialogView(control);

            control.Commited += (o, e) =>
            {
                selected?.Invoke(e.Value);
                dialog.Close();
            };
            dialog.Show();
        }