Esempio n. 1
0
        public static SpellVM Create(SpellResource model)
        {
            Func <SpellVM> factoryMethod;

            if (!_factoryMethods.TryGetValue(model.GetType(), out factoryMethod))
            {
                throw new NotSupportedException(String.Format("{0} is not supported.", model.GetType().Name));
            }

            SpellVM viewModel = factoryMethod();

            viewModel.Model = model;
            return(viewModel);
        }
Esempio n. 2
0
 private SpellVM CreateItem(SpellResource spell) => SpellViewModelFactory.Create(spell);