Inheritance: INotifyPropertyChanged
Ejemplo n.º 1
0
        public UnitViewModel(AppConfig config, MainViewModel mvm)
        {
            m_config = config;
            m_mvm = mvm;

            SendToSlotCommand = new DelegateCommand<string>(SendToSlot, x => SelectedIdol != null);
            SaveCommand = new DelegateCommand(Save, () => !string.IsNullOrEmpty(UnitName));
            DeleteCommand = new DelegateCommand(Delete, () => Units.Contains(SelectedUnit));
            MoveToSlotCommand = new DelegateCommand<string>(MoveToSlot, CanMoveToSlot);
            ResetSlotCommand = new DelegateCommand<string>(ResetSlot, CanResetSlot);
            HighlightCommand = new DelegateCommand<string>(Highlight, CanHighlight);
            CopyIidCommand = new DelegateCommand(CopyIid, () => SelectedIdol != null);
            SetGuestCenterCommand = new DelegateCommand(SetGuestCenter, () => SelectedIdol != null);
            CopyIidFromSlotCommand = new DelegateCommand<string>(CopyIidFromSlot);
            SetGuestCenterFromSlotCommand = new DelegateCommand<string>(SetGuestCenterFromSlot);

            Idols = new ListCollectionView(m_config.OwnedIdols);
            Filter = new IdolFilter(config, Idols, false);
            Filter.SetConfig(config.UnitIdolFilterConfig);

            Units = m_config.Units;

            TemporalUnit = new Unit();
            SelectedUnit = Units.FirstOrDefault();

            foreach (var option in config.UnitIdolSortOptions)
            {
                Idols.SortDescriptions.Add(option.ToSortDescription());
            }
        }
Ejemplo n.º 2
0
        public UnitViewModel(AppConfig config, MainViewModel mvm)
        {
            m_config = config;
            m_mvm    = mvm;

            SendToSlotCommand             = new DelegateCommand <string>(SendToSlot, x => SelectedIdol != null);
            SaveCommand                   = new DelegateCommand(Save, () => !string.IsNullOrEmpty(UnitName));
            DeleteCommand                 = new DelegateCommand(Delete, () => Units.Contains(SelectedUnit));
            MoveToSlotCommand             = new DelegateCommand <string>(MoveToSlot, CanMoveToSlot);
            ResetSlotCommand              = new DelegateCommand <string>(ResetSlot, CanResetSlot);
            HighlightCommand              = new DelegateCommand <string>(Highlight, CanHighlight);
            CopyIidCommand                = new DelegateCommand(CopyIid, () => SelectedIdol != null);
            SetGuestCenterCommand         = new DelegateCommand(SetGuestCenter, () => SelectedIdol != null);
            CopyIidFromSlotCommand        = new DelegateCommand <string>(CopyIidFromSlot);
            SetGuestCenterFromSlotCommand = new DelegateCommand <string>(SetGuestCenterFromSlot);

            Idols  = new ListCollectionView(m_config.OwnedIdols);
            Filter = new IdolFilter(config, Idols, false);
            Filter.SetConfig(config.UnitIdolFilterConfig);

            Units = m_config.Units;

            TemporalUnit = new Unit();
            SelectedUnit = Units.FirstOrDefault();

            foreach (var option in config.UnitIdolSortOptions)
            {
                Idols.SortDescriptions.Add(option.ToSortDescription());
            }
        }
Ejemplo n.º 3
0
        public OwnedIdolViewModel(AppConfig config, UnitViewModel uvm)
        {
            m_config = config;
            m_uvm = uvm;
            Idols = new ListCollectionView(config.OwnedIdols);
            Filter = new IdolFilter(config, Idols, false);
            Filter.SetConfig(config.OwnedIdolFilterConfig);

            foreach (var option in config.OwnedIdolSortOptions)
            {
                Idols.SortDescriptions.Add(option.ToSortDescription());
            }

            DeleteCommand = new DelegateCommand(Delete, () => SelectedIdols.Count > 0);
            CopyIidCommand = new DelegateCommand(CopyIid, () => SelectedIdols != null && SelectedIdols.Count == 1);
        }
Ejemplo n.º 4
0
        public OwnedIdolViewModel(AppConfig config, MainViewModel mvm)
        {
            m_config = config;
            m_mvm    = mvm;
            Idols    = new ListCollectionView(config.OwnedIdols);
            Filter   = new IdolFilter(config, Idols, enableOwnedFilter: false);
            Filter.SetConfig(config.OwnedIdolFilterConfig);

            foreach (var option in config.OwnedIdolSortOptions)
            {
                Idols.SortDescriptions.Add(option.ToSortDescription());
            }

            DeleteCommand         = new DelegateCommand(Delete, () => SelectedIdols != null && SelectedIdols.Count > 0);
            CopyIidCommand        = new DelegateCommand(CopyIid, () => SelectedIdols != null && SelectedIdols.Count == 1);
            SetGuestCenterCommand = new DelegateCommand(SetGuestCenter, () => SelectedIdols != null && SelectedIdols.Count == 1);
        }
Ejemplo n.º 5
0
        public ImplementedIdolViewModel(AppConfig config, OwnedIdolViewModel ovm)
        {
            m_config = config;
            m_ovm = ovm;

            Idols = new ListCollectionView(m_config.ImplementedIdols);
            Filter = new IdolFilter(config, Idols, true);
            Filter.SetConfig(config.ImplementedIdolFilterConfig);

            foreach(var option in m_config.ImplementedIdolSortOptions)
            {
                Idols.SortDescriptions.Add(option.ToSortDescription());
            }

            ReloadDataCommand = new AwaitableDelegateCommand(ReloadData);
            AddToOwnedCommand = new DelegateCommand(AddToOwned, () => SelectedIdols!=null && SelectedIdols.Count > 0);
            CopyIidCommand = new DelegateCommand(CopyIid, () => SelectedIdols != null && SelectedIdols.Count ==1);
        }
Ejemplo n.º 6
0
        public PotentialViewModel(AppConfig config)
        {
            m_config      = config;
            PotentialData = new ListCollectionView(config.PotentialData);
            Filter        = new IdolFilter(config, PotentialData,
                                           enableCenterEffectFilter: false,
                                           enableOwnedFilter: false,
                                           enableRarityFilter: false,
                                           enableSkillFilter: false,
                                           enableOwnedOnlyFilter: true
                                           );
            Filter.SetConfig(config.PotentialFilterConfig);

            foreach (var option in config.PotentialSortOptions)
            {
                PotentialData.SortDescriptions.Add(option.ToSortDescription());
            }
        }
Ejemplo n.º 7
0
        public PotentialViewModel(AppConfig config)
        {
            m_config = config;
            PotentialData = new ListCollectionView(config.PotentialData);
            Filter = new IdolFilter(config, PotentialData,
                enableCenterEffectFilter: false,
                enableOwnedFilter: false,
                enableRarityFilter: false,
                enableSkillFilter: false,
                enableOwnedOnlyFilter: true
            );
            Filter.SetConfig(config.PotentialFilterConfig);

            foreach (var option in config.PotentialSortOptions)
            {
                PotentialData.SortDescriptions.Add(option.ToSortDescription());
            }
        }
Ejemplo n.º 8
0
        public ImplementedIdolViewModel(AppConfig config, MainViewModel mvm)
        {
            m_config = config;
            m_mvm    = mvm;

            Idols  = new ListCollectionView(m_config.ImplementedIdols);
            Filter = new IdolFilter(config, Idols, true);
            Filter.SetConfig(config.ImplementedIdolFilterConfig);

            foreach (var option in m_config.ImplementedIdolSortOptions)
            {
                Idols.SortDescriptions.Add(option.ToSortDescription());
            }

            ReloadDataCommand     = new AwaitableDelegateCommand(ReloadData);
            AddToOwnedCommand     = new DelegateCommand(AddToOwned, () => SelectedIdols != null && SelectedIdols.Count > 0);
            CopyIidCommand        = new DelegateCommand(CopyIid, () => SelectedIdols != null && SelectedIdols.Count == 1);
            SetGuestCenterCommand = new DelegateCommand(SetGuestCenter, () => SelectedIdols != null && SelectedIdols.Count == 1);
        }