public DataGridSampleWpf()
        {
            InitializeComponent();
            DataContext = this;
            Items       = new ItemsCollection();

            var options = new OptionList();

            options.AddOption("Enabled", dataGrid, l => l.IsEnabled);
            options.AddOption("Multiple Rows",
                              dataGrid, c => c.SelectionMode,
                              DataGridSelectionMode.Extended,
                              DataGridSelectionMode.Single);
            options.AddOption("Full Row Select",
                              dataGrid, c => c.SelectionUnit,
                              DataGridSelectionUnit.FullRow,
                              DataGridSelectionUnit.CellOrRowHeader);
            options.AddEnumOption("Grid Lines",
                                  dataGrid, c => c.GridLinesVisibility);
            options.AddEnumOption("Headers",
                                  dataGrid, c => c.HeadersVisibility);
            options.AddOption("Wide Row Header",
                              dataGrid, c => c.RowHeaderWidth,
                              25,
                              double.NaN);
            options.AddOption("Frozen Columns", dataGrid, c => c.FrozenColumnCount);
            options.AddOption("Row Details", dataGrid,
                              c => c.RowDetailsVisibilityMode,
                              DataGridRowDetailsVisibilityMode.Visible,
                              DataGridRowDetailsVisibilityMode.Collapsed);
            Options = options;
        }
Esempio n. 2
0
        public CalendarSampleWpf()
        {
            InitializeComponent();

            options.AddOption("Enabled", calendar1, x => x.IsEnabled);
            options.AddEnumOption("DisplayMode", calendar1, x => x.DisplayMode);
            options.AddEnumOption("SelectionMode", calendar1, x => x.SelectionMode);
            options.AddOption("IsTodayHighlighted", calendar1, x => x.IsTodayHighlighted);

            var today = DateTime.Now.Date;

            calendar1.BlackoutDates.Add(
                new CalendarDateRange(
                    new DateTime(today.Year, today.Month, today.Day == 1 ? 2 : 1),
                    new DateTime(today.Year, today.Month, 3)));
            calendar1.SelectedDate = today;
        }