public MainContentViewModel()
        {
            this.Admiral   = new AdmiralViewModel();
            this.Materials = new MaterialsViewModel();
            this.Ships     = new ShipsViewModel();
            this.SlotItems = new SlotItemsViewModel();

            this.Fleets      = new FleetsViewModel();
            this.Shipyard    = new ShipyardViewModel();
            this.Quests      = new QuestsViewModel();
            this.Expeditions = new ExpeditionsViewModel(this.Fleets);

            this.TabItems = new List <TabItemViewModel>
            {
                new OverviewViewModel(this),
                this.Fleets,
                this.Shipyard,
                this.Quests,
                this.Expeditions,
                new ToolsViewModel(),
            };
            this.SystemTabItems = new List <TabItemViewModel>
            {
                new SettingsViewModel(),
                #region DEBUG
#if DEBUG
                new DebugTabViewModel(),
#endif
                #endregion
            };
            this.SelectedItem = this.TabItems.FirstOrDefault();

            this.Volume = new VolumeViewModel();
        }
		public MainContentViewModel()
		{
			this.Admiral = new AdmiralViewModel();
			this.Materials = new MaterialsViewModel();
			this.Ships = new ShipsViewModel();
			this.SlotItems = new SlotItemsViewModel();

			this.Fleets = new FleetsViewModel();
			this.Shipyard = new ShipyardViewModel();
			this.Quests = new QuestsViewModel();
			this.Expeditions = new ExpeditionsViewModel(this.Fleets);

			this.TabItems = new List<TabItemViewModel>
			{
				new OverviewViewModel(this),
				this.Fleets,
				this.Shipyard,
				this.Quests,
				this.Expeditions,
				new ToolsViewModel(),
			};
			this.SystemTabItems = new List<TabItemViewModel>
			{
				new SettingsViewModel(),
				#region DEBUG
#if DEBUG
				new DebugTabViewModel(),
#endif
				#endregion
			};
			this.SelectedItem = this.TabItems.FirstOrDefault();

			this.Volume = new VolumeViewModel();
		}
Пример #3
0
        public MainContentViewModel()
        {
            this.Admiral   = new AdmiralViewModel();
            this.Materials = new MaterialsViewModel();
            this.Ships     = new ShipsViewModel();
            this.SlotItems = new SlotItemsViewModel();

            var fleets = new FleetsViewModel();

            this.TabItems = new List <TabItemViewModel>
            {
                fleets,
                new RepairyardViewModel(),
                new DockyardViewModel(),
                new QuestsViewModel(),
                new ExpeditionsViewModel(fleets),
            };
            this.SystemTabItems = new List <TabItemViewModel>
            {
                new SettingsViewModel(),
            };
            this.SelectedItem = this.TabItems.FirstOrDefault();

            this.Volume = new VolumeViewModel();
        }
Пример #4
0
        public MainWindowViewModel()
        {
            this.Title    = AppProductInfo.Title;
            this.Settings = new SettingsViewModel();

            this.CompositeDisposable.Add(new PropertyChangedEventListener(StatusService.Current)
            {
                { () => StatusService.Current.Message, (sender, args) => this.StatusMessage = StatusService.Current.Message },
            });
            this.CompositeDisposable.Add(new PropertyChangedEventListener(KanColleClient.Current)
            {
                { () => KanColleClient.Current.IsStarted, (sender, args) => this.UpdateMode() },
                { () => KanColleClient.Current.IsInSortie, (sender, args) => this.UpdateMode() },
            });

            this._browser = new BrowserViewModel();

            this.UpdateMode();
            Models.Settings.Current.PropertyChanged += (_, __) => this.UpdateLayout(Models.Settings.Current.LRSplit);

            Fiddler.FiddlerApplication.OnReadResponseBuffer += (_, e) => DownloadActive = true;
            Fiddler.FiddlerApplication.OnReadRequestBuffer  += (_, e) => UploadActive = true;
            Fiddler.FiddlerApplication.BeforeRequest        += _ => { System.Threading.Interlocked.Increment(ref _outstandingRequests); RaisePropertyChanged(nameof(OutstandingRequests)); };
            Fiddler.FiddlerApplication.BeforeResponse       += _ => { System.Threading.Interlocked.Decrement(ref _outstandingRequests); RaisePropertyChanged(nameof(OutstandingRequests)); };
            Fiddler.FiddlerApplication.BeforeReturningError += _ => { if (_.responseCode == 408)
                                                                      {
                                                                          return;
                                                                      }
                                                                      System.Threading.Interlocked.Decrement(ref _outstandingRequests); RaisePropertyChanged(nameof(OutstandingRequests)); };

            this.Ships     = new ShipsViewModel();
            this.SlotItems = new SlotItemsViewModel();
            this.Admiral   = new AdmiralViewModel(this);
            this.Materials = new MaterialsViewModel();

            this.Fleets      = new FleetsViewModel();
            this.Shipyard    = new ShipyardViewModel();
            this.Quests      = new QuestsViewModel();
            this.Expeditions = new ExpeditionsViewModel(this.Fleets);

            this.TabItems = new ObservableCollection <TabItemViewModel>
            {
                StartContentViewModel.Instance,
                new OverviewViewModel(this),
                this.Fleets,
                this.Shipyard,
                this.Quests,
                this.Expeditions,
                new ToolsViewModel(),
                new SettingsViewModel(),
                #region DEBUG
#if false
                new DebugTabViewModel(),
#endif
                #endregion
            };
            if (_mini = Models.Settings.Current.MiniLayout)
            {
                TabItems.Insert(0, _browser);
            }
            this.SelectedItem = this.TabItems.FirstOrDefault();
        }