123456789101112131415161718192021222324252627282930313233343536 |
-
- namespace ProximaAnalizer.ViewModels;
- internal partial class LoadingViewModel : ObservableObject
- {
- public LoadingViewModel(IRegionManager regionManager, IEventAggregator eventAggregator,SqlSugarCustom sqlSugarCustom)
- {
- this._regionManager = regionManager;
- this._eventAggregator = eventAggregator;
- this._sqlSugarCustom = sqlSugarCustom;
- Task.Factory.StartNew(Initialize);
- }
- private readonly IEventAggregator _eventAggregator;
- private readonly IRegionManager _regionManager;
- private readonly SqlSugarCustom _sqlSugarCustom;
- private void Initialize()
- {
- //Thread.Sleep(2000);
- string dbString = "Database=TINReal;Password=123456;Host=localhost;Username=postgres;Persist Security Info=True";
- this._sqlSugarCustom.Initialize(null);
- this._sqlSugarCustom.Open(dbString, SqlSugar.DbType.PostgreSQL,true);
- App.Current.Dispatcher.Invoke(() =>
- {
- _eventAggregator.GetEvent<WindowSwitch>().Page = Pages.RecipeStepNavi;
- _eventAggregator.GetEvent<WindowSwitch>().Publish();
- });
- }
- }
|