Esempio 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;
                });
            });
        }
Esempio 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;
                });
            });
        }
        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 ? "#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;

                        });
                });
        }