Ejemplo n.º 1
0
        void LoadCategories()
        {
            vm.LoadCategoriesAsync().ContinueWith((result) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    var allCell = new CategoryCell
                    {
                        BindingContext = vm.AllCategory
                    };

                    TableSectionCategories.Add(allCell);

                    foreach (var item in vm.Categories)
                    {
                        TableSectionCategories.Add(new CategoryCell
                        {
                            BindingContext = item
                        });
                    }

                    var color = Device.RuntimePlatform == Device.UWP || Device.RuntimePlatform == Device.WinPhone ? "#7635EB" : string.Empty;

                    showPast = new Category
                    {
                        Name      = "Show Past Sessions",
                        IsEnabled = true,
                        ShortName = "Show Past Sessions",
                        Color     = color
                    };

                    showFavorites = new Category
                    {
                        Name      = "Show Favorites Only",
                        IsEnabled = true,
                        ShortName = "Show Favorites Only",
                        Color     = color
                    };

                    TableSectionFilters.Add(new CategoryCell
                    {
                        BindingContext = showPast
                    });

                    TableSectionFilters.Add(new CategoryCell
                    {
                        BindingContext = showFavorites
                    });

                    //if end of evolve
                    if (DateTime.UtcNow > Settings.EndOfEvolve)
                    {
                        showPast.IsEnabled = false;
                    }

                    showPast.IsFiltered      = Settings.Current.ShowPastSessions;
                    showFavorites.IsFiltered = Settings.Current.FavoritesOnly;
                });
            });
        }
Ejemplo n.º 2
0
        void LoadCategories()
        {
            vm.LoadCategoriesAsync().ContinueWith(
                (result) =>
            {
                Device.BeginInvokeOnMainThread(
                    () =>
                {
                    var allCell = new CategoryCell {
                        BindingContext = vm.AllCategory
                    };

                    TableSectionCategories.Add(allCell);

                    foreach (var item in vm.Categories)
                    {
                        TableSectionCategories.Add(new CategoryCell {
                            BindingContext = item
                        });
                    }

                    var color = Device.OS == TargetPlatform.Windows ||
                                Device.OS == TargetPlatform.WinPhone
                                                    ? ((Color)App.Current.Resources["Primary"]).ToHex()
                                                    : string.Empty;

                    showPast = new Category
                    {
                        Name      = "Show Past Sessions",
                        IsEnabled = true,
                        ShortName = "Show Past Sessions",
                        Color     = color
                    };

                    TableSectionFilters.Add(new CategoryCell {
                        BindingContext = showPast
                    });

                    //if end of evolve
                    if (DateTime.UtcNow > EventInfo.EndOfConference)
                    {
                        showPast.IsEnabled = false;
                    }

                    showPast.IsFiltered = Settings.Current.ShowPastSessions;
                });
            });
        }
Ejemplo n.º 3
0
        void ViewModel_OnAlertsCategoriesLoaded(Object sender, List <AlertCategoryModel> AlertsCategories)
        {
            TableSectionCategories.Clear();

            TableSectionCategories.Add(new CommonCategoryCell
            {
                BindingContext = ViewModel.AllCategory
            });

            foreach (var item in AlertsCategories)
            {
                var AlertCategoryCell = new AlertCategoryCell
                {
                    BindingContext = item
                };

                TableSectionCategories.Add(AlertCategoryCell);
            }
        }