예제 #1
0
        public DatabaseViewModel(MetroDialog dialog)
        {
            _databaseStorage = new XmlStorage <DatabaseSg>(
                PathHelper.Combine(MessageToken.CONFIG_FOLDER, MessageToken.DATABASEXML));
            _databaseStorage.Load();

            DatabaseSg = _databaseStorage.Storage;

            ConnectCommand = new RelayCommand(Connect);

            _dialog = dialog;
        }
예제 #2
0
 public ViewModelLocator()
 {
     try
     {
         _container = TinyIoCContainer.Current;
         //must be registered static
         _container.Register <MainViewModel>().AsSingleton();
         RegisterInstance();
         MainViewModel = _container.Resolve <MainViewModel>();
         var metroDialog = new MetroDialog(MainViewModel);
         _container.Register <MetroDialog>().AsSingleton();
         DatabaseViewModel       = _container.Resolve <DatabaseViewModel>();
         GeneralSettingViewModel = _container.Resolve <GeneralSettingViewModel>();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
 public MetroDialog(MainViewModel mainVm)
 {
     this._mainVm = mainVm;
     _instance    = this;
 }
예제 #4
0
 public PluginKVViewModel(PluginKV pluginKV)
 {
     _pluginKV = pluginKV;
     InitExecutor();
     MetroDialog = TinyIoCContainer.Current.Resolve <MetroDialog>();
 }