public ArchiveListViewModel( IRegionManager rm, ArchiveHolder holder) : base(rm) { Archive = holder.Archive; holder.PropertyChanged += (s, e) => Archive = holder.Archive; }
public InitializeViewModel( IRegionManager rm, CurrentService currentService, ArchiveService archiveService, CurrentHolder currentHolder, ArchiveHolder archiveHolder) : base(rm) { _currentService = currentService; _archiveService = archiveService; _currentHolder = currentHolder; _archiveHolder = archiveHolder; LoadedCommand = new DelegateCommand(async() => await LoadedAsync()); }
public ArchiveChartViewModel( IRegionManager rm, ArchiveHolder holder) : base(rm) { var mapper = Mappers.Xy <ArchiveViewData>().X(v => v.DateTime.Ticks).Y(v => (double)v.Count); SeriesCollection = new SeriesCollection(mapper) { new LineSeries { Title = "Archive", LineSmoothness = 0, } }; UpdateChart(holder.Archive.Archives); holder.PropertyChanged += (s, e) => UpdateChart(holder.Archive.Archives); }
public MainWindowViewModel( IEventAggregator ea, IRegionManager rm, CurrentService currentService, ArchiveService archiveService, SettingHolder settingHolder, CurrentHolder currentHolder, ArchiveHolder archiveHolder) : base(rm) { _rm = rm; _currentService = currentService; _archiveService = archiveService; _settingHolder = settingHolder; _archiveHolder = archiveHolder; _currentHolder = currentHolder; _keyboardHook = new KeyboardHook(); _rm.RegisterViewWithRegion(RegionNames.ContentRegion, typeof(Initialize)); _rm.RegisterViewWithRegion(RegionNames.ArchiveRegion, typeof(ArchiveList)); Current = _currentHolder.Current; IsNightMode = _settingHolder.Setting.IsNightMode; _currentHolder.PropertyChanged += (s, e) => Current = _currentHolder.Current; _keyboardHook.KeyboardHooked += new KeyboardHookedEventHandler(OnKeyboardHooked); NavigateOnDrawerCommand = new DelegateCommand <string>(NavigateOnDrawer); ApplyNightModeCommand = new DelegateCommand(ApplyNightMode); ResetCommand = new DelegateCommand(async() => await ResetAsync(), () => !IsLoading).ObservesProperty(() => IsLoading); // 保存テーマの適用 ThemeManager.ModifyTheme(theme => theme.SetPrimaryColor(_settingHolder.Setting.ColorPrimary.ExemplarHue.Color)); ThemeManager.ModifyTheme(theme => theme.SetSecondaryColor(_settingHolder.Setting.ColorAccent.ExemplarHue.Color)); ThemeManager.ModifyTheme(theme => theme.SetBaseTheme(_settingHolder.Setting.IsNightMode ? Theme.Dark : Theme.Light)); ea.GetEvent <UnhandledExceptionEvent>().Subscribe(UnhandledExceptionAction, ThreadOption.UIThread); }