Пример #1
0
        public TvShowCard(TvShow tvshow)
        {
            InitializeComponent();

            DB = new DataBase();
            PY = DB.GetPropertyAsync().Result;
            TC = new TvShowCardModel(tvshow);
            if (tvshow.ID == 0)
            {
                this.ToolbarItems.Add(new ToolbarItem("AddTvShow", "addmedia.png", async() =>
                {
                    TvShow mi = new TvShow((TvShow)TC.TvShowDet);

                    mi.ID      = await DB.GetNextTvShowIDAsync();
                    mi.DateIns = DateTime.Now;

                    if (await DB.InsertTvShowAsync(mi) > 0)
                    {
                        DependencyService.Get <IMessage>().ShortAlert(String.Format(AppResources.MessageTitleTvShowImported, mi.Title));
                        //disabled for multiple tap
                        ((ToolbarItem)this.ToolbarItems[0]).IsEnabled = false;
                    }
                }));
            }
        }