public MountEditor() { InitializeComponent(); MountBuilder.Mounts = MountBuilder.GetMounts(); MListBox.DataContext = MountBuilder.Mounts; MListBox.Items.SortDescriptions.Add(new SortDescription("MountId", ListSortDirection.Ascending)); FilterName.TextChanged += FilterChanged; FilterLevel.TextChanged += FilterChanged; MListBox.SelectionChanged += SelectionChanged; }
private void Save(object sender, RoutedEventArgs e) { MountBuilder.SaveMounts((IEnumerable <Mount>)MListBox.DataContext); Reload(null, null); }