Exemple #1
0
        public MainViewModel()
        {
            InitializeCollections();

            AddVideo = new RelayCommand(AddVideoExecute);
            AddCategory = new RelayCommand(AddCategoryExecute);
            RefreshCommand = new RelayCommand(RefreshAll);
            NewVideo = new VideoViewModel();
            NewCategory = new CategoryViewModel();
        }
Exemple #2
0
        private async void AddCategoryExecute()
        {
            if (NewCategory != null)
            {
                var category = new Category
                {
                    Name = NewCategory.Name,
                    Description = NewCategory.Description,
                    ImageUrl = NewCategory.BackdropUrl,
                    DateAdded = DateTime.Now,
                    IsWatched = false,
                    Keywords = NewCategory.KeywordsFormatted
                };

                await FirebaseManager.Instance.AddCategory(category);

                Categories.Add(category);

                NewCategory = new CategoryViewModel();
            }
        }