Exemplo n.º 1
0
        public EditItemVM(NinjaVM selectedNinja, ShopVM shop)
        {
            UpdatedAgility      = shop.SelectedItem.Agility.ToString();
            UpdatedName         = shop.SelectedItem.Name;
            UpdatedPrice        = shop.SelectedItem.Price.ToString();
            UpdatedStrength     = shop.SelectedItem.Strength.ToString();
            UpdatedIntelligence = shop.SelectedItem.Intelligence.ToString();
            UpdatedAgility      = shop.SelectedItem.Agility.ToString();

            this.Shop       = shop;
            _selectedNinja  = selectedNinja;
            UpdatedCategory = shop.SelectedItem.Category;
            EditItemCommand = new RelayCommand(Edit, CanEdit);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the ViewModelLocator class.
        /// </summary>
        public ViewModelLocator()
        {
            _ninjas = new NinjaListVM();
            _shop   = new ShopVM(_ninjas);
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            ////if (ViewModelBase.IsInDesignModeStatic)
            ////{
            ////    // Create design time view services and models
            ////    SimpleIoc.Default.Register<IDataService, DesignDataService>();
            ////}
            ////else
            ////{
            ////    // Create run time view services and models
            ////    SimpleIoc.Default.Register<IDataService, DataService>();
            ////}

            SimpleIoc.Default.Register <MainViewModel>();
        }
Exemplo n.º 3
0
 public AddItemVM(ShopVM shopvm)
 {
     AddCommand = new GenericCommand(Add, CanAdd);
     _shopVM    = shopvm;
 }