Пример #1
0
 public ConfigViewModel()
 {
     saveCommmand = new SimpleCommand(save);
     closeCommand = new  SimpleCommand(close);
     saveLoad     = new SaveLoadConfig();
     load();
 }
 public void StartProcess(string filePath)
 {
     //treeView_Nodes.Items.Clear();
     //treeView_Search.Items.Clear();
     msgCount         = 1;
     dataContext      = new XMLTagWindowViewModel(core);
     this.DataContext = dataContext;
     core.StartCore(filePath, this.app);
     dataContext.Title                 = filePath;
     corelCmd                          = new CorelAutomation(this.app, core);
     dataContext.CorelCmd              = corelCmd;
     core.LoadXmlFinish               += Core_LoadFinish;
     core.FilePorcentLoad             += Core_FilePorcentLoad;
     core.LoadListsFinish             += Core_LoadListsFinish;
     core.LoadStarting                += Core_LoadStarting;
     core.ErrorFound                  += Core_ErrorFound;
     core.SearchResultEvent           += Core_SearchResultEvent;
     core.LoadFinish                  += Core_LoadFinish1;
     core.NewMessage                  += Core_NewMessage;
     core.RequestUIHideVisibleChanged += Core_RequestUIHideVisibleChanged;
     dataContext.InCorel               = core.InCorel;
     //treeView_Nodes.GotFocus += (s, e) => { if (treeView_Nodes.SelectedItem != null) UpdateDetails(treeView_Nodes.SelectedItem, e); };
     //treeView_Ref.GotFocus += (s, e) => { if (treeView_Ref.SelectedItem != null) UpdateDetails(treeView_Ref.SelectedItem, e); };
     //treeView_Search.GotFocus += (s, e) => { if (treeView_Search.SelectedItem != null) UpdateDetails(treeView_Search.SelectedItem, e); };
     treeView_Nodes.SelectedItemChanged += (s, e) => { if (treeView_Nodes.SelectedItem != null)
                                                       {
                                                           UpdateDetails(treeView_Nodes.SelectedItem, e);
                                                       }
     };
     treeView_Ref.SelectedItemChanged += (s, e) => { if (treeView_Ref.SelectedItem != null)
                                                     {
                                                         UpdateDetails(treeView_Ref.SelectedItem, e);
                                                     }
     };
     treeView_Search.SelectedItemChanged += (s, e) => { if (treeView_Search.SelectedItem != null)
                                                        {
                                                            UpdateDetails(treeView_Search.SelectedItem, e);
                                                        }
     };
     dataContext.XmlDecode += DataContext_XmlDecode;
     inputControl.Core      = core;
     saveLoad = new SaveLoadConfig();
 }