protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); TreeViewViewModel _vm = (TreeViewViewModel)DataContext; _vm.GetPath = () => "Result of the FileOpenDialog"; }
public MainWindow() { InitializeComponent(); // create and assign view model instance to the window's data context on Loaded event Loaded += (s, e) => DataContext = new TreeViewViewModel(); }
public TreeViewModel(IConfiguration config, IMfgResources resources, TreeViewViewModel viewModel, DataTableViewModel dataTable) { this.config = config; this.resources = resources; this.viewModel = viewModel; this.dataTable = dataTable; }
public void TestTreeViewViewModelCreation() { // This test is trivial. Add your own tests for the logic you add to the ViewModel. var vm = new TreeViewViewModel(); Assert.IsNotNull(vm); }
public ActionResult TreeNodeInitialization(string uniqueID) { TreeViewViewModel treeViewViewModel = (TreeViewViewModel)this.ViewManager.GetParentViewModel(() => uniqueID); treeViewViewModel.ClearCollection(); return(new AppChanges()); }
public MainWindow() { TreeViewViewModel treeViewViewModel = new TreeViewViewModel(); DataContext = treeViewViewModel; treeViewViewModel.FileXmlPathOpener = new XmlFileOpener(); treeViewViewModel.FilePathCreator = new XmlFileCreator(); treeViewViewModel.FileDllPathOpener = new DllFileOpener(); InitializeComponent(); }
// ***************************** ***************************** ***************************** // Constructor y carga de elementos. public AddOrganigramaAsuntoViewModel(AsuntoModViewModel asuntoModViewModel) { this._AsuntoModViewModel = asuntoModViewModel; this._SelectedOrganigrama = asuntoModViewModel._ParentAsunto._PantallaInicioViewModel._MainWindowViewModel.Usuario.Rol.Organigrama; this.AddItem = new List<OrganigramaModel>(); this._TreeView = new TreeViewViewModel(); this.Organigramas = new ObservableCollection<OrganigramaModel>(); this._OrganigramaRepository = new GestorDocument.DAL.Repository.OrganigramaRepository(); this.LoadInfoGrid(); }
public MainWindow() { InitializeComponent(); DataContext = new TreeViewViewModel(); #region delegate //btnFillTreeView.Click += delegate //{ // //реализовать очистку дерева перед заполнением // treeView_Catalov_Level.ItemsSource = new TreeViewViewModel(); //}; #endregion }
public MainWindow() { try { Log log = new Log(); log.LogMessageToFile("Program started!!!"); InitializeComponent(); OpenGlDisplay openGLDisplay1 = new OpenGlDisplay(openGLControl1, false, 1f, 0f, 0f); OpenGlDisplay openGLDisplay2 = new OpenGlDisplay(openGLControl2, false, 1f, 0f, 0f); OpenGlDisplay openGLDisplay3 = new OpenGlDisplay(openGLControl3, false, 1f, 0f, 0f); OpenGlDisplay openGLDisplay4 = new OpenGlDisplay(openGLControl4, false, 1f, 0f, 0f); OpenGlDisplay openGLDisplay5 = new OpenGlDisplay(openGLControl5, false, 1f, 0f, 0f); OpenGlDisplay openGLDisplay6 = new OpenGlDisplay(openGLControl6, false, 1f, 0f, 0f); SettingProgram settingProgramDataHandler = SettingService.LoadSettingProgram(); SettingWindow settingWindowDataHandler = SettingService.LoadSettingWindow(); SettingFBGA settingFBGADataHandler = SettingService.LoadSettingFBGA(); SettingMIC settingMICDataHandler = SettingService.LoadSettingMIC(); SettingECG settingECGDataHandler = SettingService.LoadSettingECG(); SettingACC settingACCDataHandler = SettingService.LoadSettingACC(); SettingPPG settingPPGDataHandler = SettingService.LoadSettingPPG(); TreeViewViewModel treeViewHandler = new TreeViewViewModel(); Tree.DataContext = treeViewHandler; OpenGLDispatcher openGLDispatcherHandler = new OpenGLDispatcher(openGLDisplay1, openGLDisplay2, openGLDisplay3, openGLDisplay4, openGLDisplay5, openGLDisplay6, settingMICDataHandler.NumberOfChannels, settingFBGADataHandler.NumberOfChannels, settingECGDataHandler.NumberOfChannels, settingACCDataHandler.NumberOfChannels, settingPPGDataHandler.NumberOfChannels); MainWindowViewModel mainWindowHandler = new MainWindowViewModel(treeViewHandler, openGLDispatcherHandler, settingProgramDataHandler, settingWindowDataHandler, settingFBGADataHandler, settingMICDataHandler, settingECGDataHandler, settingACCDataHandler, settingPPGDataHandler); treeViewHandler.addParent(mainWindowHandler); DataContext = mainWindowHandler; device = new Device(mainWindowHandler); } catch (Exception ex) { Log log = new Log(); log.LogMessageToFile(ex.Message); Dialogs.DialogMessage.DialogMessageViewModel dvm = new Dialogs.DialogMessage.DialogMessageViewModel(Dialogs.DialogMessage.DialogImageTypeEnum.Error, ex.Message); Dialogs.DialogService.DialogResult result = Dialogs.DialogService.DialogService.OpenDialog(dvm); } }
public MainWindow() { InitializeComponent(); Procedure proc = new Procedure("procedure a", "procA"); Procedure proc2 = new Procedure("procedure b", "procB"); List <Procedure> procList = new List <Procedure>(); procList.Add(proc); procList.Add(proc2); RootViewModel rootViewModel = new RootViewModel(procList); base.DataContext = rootViewModel; List <RootViewModel> rootList = new List <RootViewModel>(); rootList.Add(rootViewModel); TreeViewViewModel viewModel = new TreeViewViewModel(rootList); base.DataContext = viewModel; }
private void OnShowTreeViewButtonClicked(object sender, RoutedEventArgs e) { var tree = new TreeViewViewModel(); var window = DependencyResolver.Instance.Get <IModalWindow <WindowViewModel> >(); var windowViewModel = new WindowViewModel { Content = tree }; window.SetViewModel(windowViewModel); tree.GetModel().Items.Add(new TextBlockModel { Text = "TopLevel1" }); tree.GetModel().Items.Add(new TextBlockModel { Text = "TopLevel2" }); //tree.GetModel().Items[0].Items.Add(new TextBlockModel { Text = "SubNode 1.1" }); window.ShowDialog(); }
public static object get_Sorted(this TreeViewViewModel tree) { throw new System.NotImplementedException(); }
public AdministrationWindowViewModel() { TreeViewViewModel = new TreeViewViewModel(); CarDataGridViewModel = new CarDataGridViewModel(); TreeViewViewModel.ItemSelected += CarDataGridViewModel.c_ItemSelected; }