public void Destroy() { this.sortingModel.SetCollectionView(null); this.sortingModel = null; this.sampleObjects.Clear(); this.sampleObjects = null; }
/// <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; }
public void Initialize() { this.sortingModel = new SortingModel(); this.sampleObjects = SampleObject.GetList(); this.sortingModel.SetCollectionView(DataWrapper.Wrap(this.sampleObjects)); }