Пример #1
0
        public void Execute(object parameter)
        {
            ItemID_ItemPage_Class data  = parameter as ItemID_ItemPage_Class;
            ItemViewModel         vm    = data._ItemViewPage.Resources["ItemVM"] as ItemViewModel;
            ItemPopup             popup = new ItemPopup();

            popup.Resources["ItemVM"] = vm;
            vm.IsItemPopup            = true;
            ItemPopupViewModel popUpVM = popup.Resources["PopUpVM"] as ItemPopupViewModel;
            ItemModel          model   = DBConnecter.getItem(data.ItemID);

            popUpVM.Shop_Name = model.Shop_Name;
            popUpVM.Memo      = model.Memo;
            popUpVM.Name      = model.Name;
            popUpVM.Link      = model.Link;
            popUpVM.Item_ID   = model.Item_ID;
            popUpVM.Price     = model.Price;
            if (model.Liked == 1)
            {
                popUpVM.Liked = true;
            }
            else
            {
                popUpVM.Liked = false;
            }
            popUpVM.Temp     = model.Temp;
            popUpVM.Image    = model.Image;
            popUpVM.Category = model.Category;
            popup.Show();
        }
Пример #2
0
        public bool CanExecute(object parameter)
        {
            ItemID_ItemPage_Class data = parameter as ItemID_ItemPage_Class;
            ItemViewModel         vm   = data._ItemViewPage.Resources["ItemVM"] as ItemViewModel;

            return(vm == null ? true : !(vm.IsItemPopup));
        }