Ejemplo n.º 1
0
        public InformationViewModel()
        {
            this.Settings = SettingsHost.Instance <KanColleWindowSettings>();
            if (this.Settings?.Dock == Dock.Right || this.Settings?.Dock == Dock.Left || this.Settings?.IsSplit)
            {
                this.Vertical   = Visibility.Collapsed;
                this.Horizontal = Visibility.Visible;
            }
            else
            {
                this.Vertical   = Visibility.Visible;
                this.Horizontal = Visibility.Collapsed;
            }
            this.TabItems = new List <TabItemViewModel>
            {
                (this.Overview = new OverviewViewModel(this).AddTo(this)),
                (this.Fleets = new FleetsViewModel().AddTo(this)),
                (this.Shipyard = new ShipyardViewModel(this.Fleets).AddTo(this)),
                (this.Quests = new QuestsViewModel(this.Fleets).AddTo(this)),
                (this.Expeditions = new ExpeditionsViewModel(this.Fleets).AddTo(this)),
                (this.Tools = new ToolsViewModel(this.Fleets).AddTo(this)),
            };
            this.SystemTabItems = new List <TabItemViewModel>
            {
                SettingsViewModel.Instance,
                #region DEBUG
#if DEBUG
                new DebugTabViewModel().AddTo(this),
#endif
                #endregion
            };
            this.SelectedItem = this.TabItems.FirstOrDefault();

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

            _AkashiTimer = new AkashiTimerViewModel();

            KanColleSettings.DisplayMaterialExtended.ValueChanged += (s, e) => this.MaterialExtended = e.NewValue;
            this.MaterialExtended = KanColleSettings.DisplayMaterialExtended;
        }
Ejemplo n.º 2
0
        public InformationViewModel()
        {
            this.Settings = SettingsHost.Instance <KanColleWindowSettings>();
            if (this.Settings?.Dock == Dock.Right || this.Settings?.Dock == Dock.Left || this.Settings?.IsSplit)
            {
                this.Vertical   = Visibility.Collapsed;
                this.Horizontal = Visibility.Visible;
            }
            else
            {
                this.Vertical   = Visibility.Visible;
                this.Horizontal = Visibility.Collapsed;
            }
            this.TabItems = new List <TabItemViewModel>
            {
                (this.Overview = new OverviewViewModel(this).AddTo(this)),
                (this.Fleets = new FleetsViewModel().AddTo(this)),
                (this.Shipyard = new ShipyardViewModel(this.Fleets).AddTo(this)),
                (this.Quests = new QuestsViewModel(this.Fleets).AddTo(this)),
                (this.Expeditions = new ExpeditionsViewModel(this.Fleets).AddTo(this)),
                (this.Tools = new ToolsViewModel(this.Fleets).AddTo(this)),
            };
            this.SystemTabItems = new List <TabItemViewModel>
            {
                SettingsViewModel.Instance,
                #region DEBUG
#if DEBUG
                new DebugTabViewModel().AddTo(this),
#endif
                #endregion
            };
            this.SelectedItem = this.TabItems.FirstOrDefault();

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

            this.CompositeDisposable.Add(new PropertyChangedEventListener(this.Ships)
            {
                { nameof(this.Ships.Count), (sender, args) => this.RaisePropertyChanged(nameof(this.ShipsCountWarning)) }
            });
            this.CompositeDisposable.Add(new PropertyChangedEventListener(this.SlotItems)
            {
                { nameof(this.SlotItems.Count), (sender, args) => this.RaisePropertyChanged(nameof(this.SlotItemsCountWarning)) }
            });
            this.CompositeDisposable.Add(new PropertyChangedEventListener(KanColleWrapper.KanColleClient.Current.Homeport)
            {
                { nameof(KanColleWrapper.KanColleClient.Current.Homeport.Admiral), (sender, args) => {
                      this.CompositeDisposable.Add(new PropertyChangedEventListener(KanColleWrapper.KanColleClient.Current.Homeport.Admiral)
                        {
                            { nameof(KanColleWrapper.KanColleClient.Current.Homeport.Admiral.MaxShipCount), (sender2, args2) => this.RaisePropertyChanged(nameof(this.ShipsCountWarning)) },
                            { nameof(KanColleWrapper.KanColleClient.Current.Homeport.Admiral.MaxSlotItemCount), (sender2, args2) => this.RaisePropertyChanged(nameof(this.SlotItemsCountWarning)) }
                        });
                      this.RaisePropertyChanged(nameof(this.ShipsCountWarning));
                      this.RaisePropertyChanged(nameof(this.SlotItemsCountWarning));
                  } }
            });

            _AkashiTimer = new AkashiTimerViewModel();

            KanColleSettings.DisplayMaterialExtended.ValueChanged += (s, e) => this.MaterialExtended = e.NewValue;
            this.MaterialExtended = KanColleSettings.DisplayMaterialExtended;
        }