示例#1
0
        public AboutViewModel()
        {
            AboutItems.Clear();

            InfoItems.AddRange(new[]
            {
                new MenuItem {
                    Name = "About this app", Icon = "icon_venue.png", Parameter = "about"
                },
                new MenuItem {
                    Name = "Sponsors", Icon = "icon_venue.png", Parameter = "sponsors"
                },
                new MenuItem {
                    Name = "Event Map", Icon = "icon_venue.png", Parameter = "floor-maps"
                },
                //new MenuItem { Name = "Lunch Locations", Icon = "ic_restaurant_menu.png", Parameter = "lunch-locations"},
                new MenuItem {
                    Name = "Venue", Icon = "icon_venue.png", Parameter = "venue"
                },
            });

            accountItem = new MenuItem
            {
                Name = "Logged in as:"
            };

            syncItem = new MenuItem
            {
                Name = "Last Sync:"
            };

            UpdateItems();

            AccountItems.Add(accountItem);
            AccountItems.Add(syncItem);

            //This will be triggered wen
            Settings.PropertyChanged += async(sender, e) =>
            {
                if (e.PropertyName == "Email")
                {
                    Settings.NeedsSync = true;

                    UpdateItems();

                    OnPropertyChanged("LoginText");
                    OnPropertyChanged("AccountItems");
                    //if logged in you should go ahead and sync data.
                    if (Settings.IsLoggedIn)
                    {
                        await ExecuteSyncCommandAsync();
                    }
                }

                if (e.PropertyName == "Email" || e.PropertyName == "LastSync" || e.PropertyName == "PushNotificationsEnabled")
                {
                    OnPropertyChanged("AccountItems");
                }
            };
        }
示例#2
0
        public AboutViewModel()
        {
            AboutItems.Clear();
            AboutItems.Add(new MenuItem {
                Name = "About this app", Icon = "icon_venue.png"
            });

            InfoItems.AddRange(new[]
            {
                new MenuItem {
                    Name = "Sponsors", Icon = "icon_venue.png", Parameter = "sponsors"
                },
                new MenuItem {
                    Name = "Event Map", Icon = "icon_venue.png", Parameter = "floor-maps"
                },
                new MenuItem {
                    Name = "Lunch Locations", Icon = "ic_restaurant_menu.png", Parameter = "lunch-locations"
                },
                new MenuItem {
                    Name = "Venue", Icon = "icon_venue.png", Parameter = "venue"
                },
            });

            accountItem = new MenuItem
            {
                Name = "Logged in as:"
            };

            syncItem = new MenuItem
            {
                Name = "Last Sync:"
            };

            UpdateItems();

            AccountItems.Add(accountItem);
            AccountItems.Add(syncItem);

            //This will be triggered wen
            Settings.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "Email" || e.PropertyName == "LastSync" || e.PropertyName == "PushNotificationsEnabled")
                {
                    UpdateItems();
                    OnPropertyChanged("AccountItems");
                }
            };
        }
示例#3
0
        public AboutViewModel()
        {
            AboutItems.Clear();
            AboutItems.Add(new MenuItem {
                Name = "About this app", Icon = "icon_venue.png"
            });

            if (!FeatureFlags.SponsorsOnTabPage)
            {
                InfoItems.Add(new MenuItem {
                    Name = "Friends", Icon = "icon_venue.png", Parameter = "sponsors"
                });
            }

            // pushItem.Command = new Command(
            // () =>
            // {
            // if (push.IsRegistered)
            // {
            // UpdateItems();
            // return;
            // }

            // if (Settings.AttemptedPush)
            // {
            // MessagingService.Current.SendMessage<MessagingServiceQuestion>(
            // MessageKeys.Question,
            // new MessagingServiceQuestion
            // {
            // Title = "Push Notification",
            // Question =
            // "To enable push notifications, please go into Settings, Tap Notifications, and set Allow Notifications to on.",
            // Positive = "Settings",
            // Negative = "Maybe Later",
            // OnCompleted = (result) =>
            // {
            // if (result)
            // {
            // push.OpenSettings();
            // }
            // }
            // });
            // return;
            // }

            // push.RegisterForNotifications();
            // });
        }
示例#4
0
        public AboutViewModel()
        {
            AboutItems.Clear();
            AboutItems.Add(new MenuItem {
                Name = "About this app", Icon = "icon_venue.png"
            });
            push = DependencyService.Get <IPushNotifications>();

            if (!FeatureFlags.SponsorsOnTabPage)
            {
                InfoItems.Add(new MenuItem {
                    Name = "Sponsors", Icon = "icon_venue.png", Parameter = "sponsors"
                });
            }
            if (FeatureFlags.EvalEnabled)
            {
                InfoItems.Add(new MenuItem {
                    Name = "Evaluations", Icon = "icon_venue.png", Parameter = "evaluations"
                });
            }

            InfoItems.Add(new MenuItem {
                Name = "Venue", Icon = "icon_venue.png", Parameter = "venue"
            });

            if (FeatureFlags.FloormapEnabled)
            {
                InfoItems.Add(new MenuItem {
                    Name = "Conference Floor Maps", Icon = "icon_venue.png", Parameter = "floor-maps"
                });
            }

            if (FeatureFlags.CodeOfConductEnabled)
            {
                InfoItems.Add(new MenuItem {
                    Name = AboutThisApp.CodeOfConductPageTitle, Icon = "icon_code_of_conduct.png", Parameter = "code-of-conduct"
                });
            }
            if (FeatureFlags.WifiEnabled)
            {
                InfoItems.Add(new MenuItem {
                    Name = "Wi-Fi Information", Icon = "icon_wifi.png", Parameter = "wi-fi"
                });
            }
            accountItem = new MenuItem
            {
                Name = "Logged in as:"
            };

            syncItem = new MenuItem
            {
                Name = "Last Sync:"
            };

            pushItem = new MenuItem
            {
                Name = "Enable push notifications"
            };

            pushItem.Command = new Command(() =>
            {
                if (push.IsRegistered)
                {
                    UpdateItems();
                    return;
                }

                if (Settings.AttemptedPush)
                {
                    MessagingService.Current.SendMessage <MessagingServiceQuestion>(MessageKeys.Question, new MessagingServiceQuestion
                    {
                        Title       = "Push Notification",
                        Question    = "To enable push notifications, please go into Settings, Tap Notifications, and set Allow Notifications to on.",
                        Positive    = "Settings",
                        Negative    = "Maybe Later",
                        OnCompleted = (result) =>
                        {
                            if (result)
                            {
                                push.OpenSettings();
                            }
                        }
                    });
                    return;
                }

                push.RegisterForNotifications();
            });

            UpdateItems();

            if (FeatureFlags.LoginEnabled)
            {
                AccountItems.Add(accountItem);
            }
            AccountItems.Add(syncItem);
            AccountItems.Add(pushItem);

            if (!FeatureFlags.LoginEnabled && FeatureFlags.AppToWebLinkingEnabled)
            {
                AccountItems.Add(new MenuItem {
                    Name = "Link app data to website", Icon = "icon_linkapptoweb.png", Parameter = "mobiletowebsync"
                });
                AccountItems.Add(new MenuItem {
                    Name = "Link website data to app", Icon = "icon_linkapptoweb.png", Parameter = "webtomobilesync"
                });
            }

            //This will be triggered wen
            Settings.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "Email" || e.PropertyName == "LastSync" || e.PropertyName == "PushNotificationsEnabled")
                {
                    UpdateItems();
                    OnPropertyChanged("AccountItems");
                }
            };
        }
示例#5
0
        public AboutViewModel()
        {
            AboutItems.Clear();
            // AboutItems.Add(new MenuItem { Name = "About this app", Icon = "icon_venue.png" });
            push = DependencyService.Get <IPushNotifications>();

            //InfoItems.AddRange(new []
            //    {
            //        new MenuItem { Name = "News", Icon = "icon_venue.png", Parameter="news"},
            //         new MenuItem { Name = "Notifications", Icon = "icon_venue.png", Parameter="notifications"},//binny
            //        new MenuItem { Name = "Feedback & Ratings", Icon = "icon_venue.png", Parameter="feedback-ratings"},
            //        new MenuItem { Name = "Maps", Icon = "icon_venue.png", Parameter = "maps"},
            //        new MenuItem { Name = "Restaurant Floor Plans", Icon = "icon_venue.png", Parameter = "restaurant-maps"},
            //        new MenuItem { Name = "Sealegs Promise", Icon = "icon_code_of_conduct.png", Parameter="sealegs-promise" },
            //        new MenuItem { Name = "Wi-Fi Information", Icon = "icon_wifi.png", Parameter="wi-fi" },
            //    });

            //accountItem = new MenuItem
            //    {
            //        Name = "Logged in as:"
            //    };

            //syncItem = new MenuItem
            //    {
            //        Name = "Last Sync:"
            //    };

            pushItem = new MenuItem
            {
                Name = "Enable push notifications"
            };

            pushItem.Command = new Command(() =>
            {
                MessagingService.Current.SendMessage <MessagingServiceQuestion>(MessageKeys.Question, new MessagingServiceQuestion
                {
                    Title       = "Push Notification",
                    Question    = "To enable push notifications, please go into Settings, Tap Notifications, and set Allow Notifications to on.",
                    Positive    = "Settings",
                    Negative    = "Maybe Later",
                    OnCompleted = (result) =>
                    {
                        if (result)
                        {
                            push.OpenSettings();
                        }
                    }
                });

                push.RegisterForNotifications();
                pushItem.Name = "Push notifications enabled";
                return;
            });

            // UpdateItems();

            // AccountItems.Add(accountItem);
            // AccountItems.Add(syncItem);
            AccountItems.Add(pushItem);

            //This will be triggered wen
            //Settings.PropertyChanged += (sender, e) =>
            //    {
            //        if(e.PropertyName == "Email" || e.PropertyName == "LastSync" || e.PropertyName == "PushNotificationsEnabled")
            //        {
            //            UpdateItems();
            //            RaisePropertyChanged("AccountItems");
            //        }
            //    };
        }
        public AboutViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService)
            : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
        {
            ToolBarItems.Add(new ToolbarItem
            {
                Text = LoginText,
                Command = LoginCommand
            });
            AboutItems.Clear();
            AboutItems.Add(new Models.MenuItem { Name = "About this app", Icon = "icon_venue.png" });

            InfoItems.AddRange(new[] 
            {
                new Models.MenuItem { Name = "Conference Feed", Icon = "menu_feed.png", Pagename = nameof(FeedPage) },
                new Models.MenuItem { Name = "Sponsors", Icon = "menu_sponsors.png", Pagename = nameof(SponsorsPage) },
                new Models.MenuItem { Name = "Venue", Icon = "menu_venue.png", Pagename = nameof(VenuePage) },
                new Models.MenuItem { Name = "Floor Maps", Icon = "menu_plan.png", Pagename = nameof(FloorMapsPage) },
                new Models.MenuItem { Name = "Conference Info", Icon = "menu_info.png", Pagename = nameof(ConferenceInformationPage) },
                new Models.MenuItem { Name = "Settings", Icon = "menu_settings.png", Pagename = nameof(SettingsPage) }
            });

            accountItem = new Models.MenuItem
            {
                Name = "Logged in as:"
            };

            syncItem = new Models.MenuItem
            {
                Name = "Last Sync:"
            };

            pushItem = new Models.MenuItem
            {
                Name = "Enable push notifications"
            };

            pushItem.Command = DelegateCommand.FromAsyncHandler(async () =>
            {
                if (PushNotifications.IsRegistered)
                {
                    UpdateItems();
                    return;
                }

                if (Settings.AttemptedPush)
                {
                    var response = await PageDialogService.DisplayAlertAsync("Push Notification",
                        "To enable push notifications, please go into Settings, Tap Notifications, and set Allow Notifications to on.",
                        "Settings",
                        "Maybe Later");

                    if (response)
                    {
                        PushNotifications.OpenSettings();
                    }
                }

                await PushNotifications.RegisterForNotifications();
            });

            UpdateItems();

            AccountItems.Add(accountItem);
            AccountItems.Add(syncItem);
            AccountItems.Add(pushItem);

            //This will be triggered wen 
            Settings.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "Email" || e.PropertyName == "LastSync" || e.PropertyName == "PushNotificationsEnabled")
                {
                    UpdateItems();
                    OnPropertyChanged("AccountItems");
                }
            };

            AccountItems.CollectionChanged += (sender, e) =>
            {
                AccountListHeightAdjustment = AccountItems.Count;
            };
            AccountListHeightAdjustment = AccountItems.Count;

            _isRegistered = PushNotifications.IsRegistered;
        }
示例#7
0
        public AboutViewModel()
        {
            AboutItems.Clear();
            //AboutItems.Add(new MenuItem { Name = "About this app", Icon = "icon_venue.png" });
            push = DependencyService.Get <IPushNotifications>();

            InfoItems.AddRange(new []
            {
                new MenuItem {
                    Name = "Sponsorlar", Icon = "icon_venue.png", Parameter = "sponsors"
                },
                //new MenuItem { Name = "Evaluations", Icon = "icon_venue.png", Parameter="evaluations"},
                new MenuItem {
                    Name = "Etkinlik Alanı", Icon = "icon_venue.png", Parameter = "venue"
                },
                new MenuItem {
                    Name = "Kat Planı", Icon = "icon_venue.png", Parameter = "floor-maps"
                },
                new MenuItem {
                    Name = "Code of Conduct", Icon = "icon_code_of_conduct.png", Parameter = "code-of-conduct"
                },
                new MenuItem {
                    Name = "Wi-Fi Bilgisi", Icon = "icon_wifi.png", Parameter = "wi-fi"
                },
            });

            //accountItem = new MenuItem
            //    {
            //        Name = "Logged in as:"
            //    };

            //syncItem = new MenuItem
            //{
            //    Name = "Last Sync:"
            //};

            pushItem = new MenuItem
            {
                Name = "Bildirimleri Etkinleştir"
            };

            pushItem.Command = new Command(() =>
            {
                if (push.IsRegistered)
                {
                    UpdateItems();
                    return;
                }

                if (Settings.AttemptedPush)
                {
                    MessagingService.Current.SendMessage <MessagingServiceQuestion>(MessageKeys.Question, new MessagingServiceQuestion
                    {
                        Title       = "Bildirimler",
                        Question    = "To enable push notifications, please go into Settings, Tap Notifications, and set Allow Notifications to on.",
                        Positive    = "Settings",
                        Negative    = "Maybe Later",
                        OnCompleted = (result) =>
                        {
                            if (result)
                            {
                                push.OpenSettings();
                            }
                        }
                    });
                    return;
                }

                push.RegisterForNotifications();
            });

            UpdateItems();

            //AccountItems.Add(accountItem);
            //AccountItems.Add(syncItem);
            AccountItems.Add(pushItem);

            //This will be triggered wen
            Settings.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "Email" || e.PropertyName == "LastSync" || e.PropertyName == "PushNotificationsEnabled")
                {
                    UpdateItems();
                    OnPropertyChanged("AccountItems");
                }
            };
        }