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; }
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; } }
public MetroDialog(MainViewModel mainVm) { this._mainVm = mainVm; _instance = this; }
public PluginKVViewModel(PluginKV pluginKV) { _pluginKV = pluginKV; InitExecutor(); MetroDialog = TinyIoCContainer.Current.Resolve <MetroDialog>(); }