Exemplo n.º 1
0
 public CraftingProcessView(CurrencyFactory factory, IItemConfigRepository configRepository, EquipmentFactory equipmentFactory)
 {
     _configRepository = configRepository;
     _equipmentFactory = equipmentFactory;
     CraftingTree      = new CraftingTree(factory);
     Tree = new CraftingTreeViewModel(CraftingTree, _selected);
     InitializeComponent();
     DataContext = this;
 }
Exemplo n.º 2
0
        public ItemBaseViewModel(IItemConfigRepository configRepository, EquipmentFetch equipmentFetch, ItemConfig config)
        {
            this._configRepository = configRepository;
            base.DisplayName       = "Item Config";
            _equipmentFetch        = equipmentFetch;
            _itemTypeOptions       = _equipmentFetch.FetchSubtypes().ToArray();
            _config = new ItemConfig();

            ItemLevel = config.ItemLevel.ToString();
            ItemType  = config.ItemType;
            ItemBase  = config.ItemBase;
        }
Exemplo n.º 3
0
        public WorkspaceFactory(
            IItemConfigRepository configRepository,
            EquipmentFetch equipmentFetch,
            CurrencyFactory currencyFactory,
            IRegionManager regionManager)
        {
            _configRepository = configRepository;
            _equipmentFetch   = equipmentFetch;
            _currencyFactory  = currencyFactory;
            _regionManager    = regionManager;

            _itemInput = new CommandViewModel(
                "Item Info",
                new DelegateCommand(() => Navigate(typeof(ItemBaseView).FullName)),
                () => true);

            _craftingProcess = new CommandViewModel(
                "Crafting Process",
                new DelegateCommand(() => Navigate(typeof(CraftingProcessView).FullName)),
                () => _configRepository.GetItemConfig().IsValid);

            _itemSelection = new CommandViewModel(
                "Item Selection",
                new DelegateCommand(() => Navigate(typeof(ItemBaseView).FullName)),
                () => _configRepository.GetItemConfig().IsValid);

            _craftItems = new CommandViewModel(
                "Craft Items",
                new DelegateCommand(() => Navigate(typeof(ItemBaseView).FullName)),
                () => false);

            _viewResults = new CommandViewModel(
                "View Results",
                new DelegateCommand(() => Navigate(typeof(ItemBaseView).FullName)),
                () => false);

            Workspaces = new List <CommandViewModel>
            {
                _itemInput,
                _craftingProcess,
                _itemSelection,
                _craftItems,
                _viewResults
            };

            _configRepository.ConfigChanged += (x, y) => _itemInput.UpdateIsEnabled();
            _configRepository.ConfigChanged += (x, y) => _craftingProcess.UpdateIsEnabled();
        }