Example #1
0
 public void InitializeSelectionModel()
 {
     this.selectionModel = new SelectionModel();
     this.selectionModel.Items = (from index in Enumerable.Range(0, 100)
                                  select new object()).ToArray();
     this.selectionModel.OnRegister();
 }
Example #2
0
        /// <summary>
        /// Represents a control for displaying and manipulating data with a default tabular view.
        /// </summary>
        public DataGrid()
        {
            this.DefaultStyleKey = typeof(DataGrid);
            this.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.Name);
            this.otherColumns = new List<Column>();

            this.SetBinding(itemsSourceListenerProperty, itemsSourceBinding);

            this.itemsSourceChanged += this.DataGrid_ItemsSourceChanged;

            // TODO: move these to a startup Controller (page 19 and 20 of "Pure MVC - Best Practices")
            DataGridFacade.Instance.RegisterController(new DataGridController(this));
            DataGridFacade.Instance.RegisterModel(this.sortingModel = new SortingModel());
            DataGridFacade.Instance.RegisterModel(this.selectionModel = new SelectionModel());

            dataItemToIndexBinding.ConverterParameter = this.Items;

            // HACK: VS fails to copy references used only in XAML
            NumericUpDown n;
        }
Example #3
0
 public void DestroySelectionModel()
 {
     this.selectionModel.OnRemove();
     this.selectionModel.Items = null;
     this.selectionModel = null;
 }