Inheritance: INotifyPropertyChanged, IDisposable
Exemplo n.º 1
0
        private void New_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var dm = new Datamodel.Datamodel("my_format", 1);
            dm.Root = new Element(dm, "root");

            var vm = new ViewModel(dm);
            Datamodels.Add(vm);
            Tabs.SelectedItem = vm;
            
            e.Handled = true;
        }
Exemplo n.º 2
0
        public void Load_UI(params string[] paths)
        {
            if (Properties.Settings.Default.Recent == null) Properties.Settings.Default.Recent = new System.Collections.Specialized.StringCollection();
            var recent = Properties.Settings.Default.Recent;

            ViewModel new_dm = null;
            foreach (var path in paths)
            {
                new_dm = new ViewModel(Load(path)) { File = new FileInfo(path) };
                Datamodels.Add(new_dm);
                recent.Remove(path);
                recent.Insert(0, path);
            }
            while (recent.Count > 10)
                recent.RemoveAt(9);
            Tabs.SelectedItem = new_dm;
            RecentMenu.Items.Refresh();
        }