Пример #1
0
 public AboutPage()
 {
     this.InitializeComponent();
     this.BindingContext   = null;
     this.push             = DependencyService.Get <IPushNotifications>();
     this.isPushRegistered = this.push.IsRegistered;
 }
Пример #2
0
        public AboutPage()
        {
            InitializeComponent();
            BindingContext = vm = new AboutViewModel();
            push           = DependencyService.Get <IPushNotifications>();
            var adjust = Device.OS != TargetPlatform.Android ? 1 : -vm.AboutItems.Count + 1;

            ListViewAbout.HeightRequest = (vm.AboutItems.Count * ListViewAbout.RowHeight) - adjust;
            ListViewAbout.ItemTapped   += (sender, e) => ListViewAbout.SelectedItem = null;
            ListViewInfo.HeightRequest  = (vm.InfoItems.Count * ListViewInfo.RowHeight) - adjust;

            ListViewAbout.ItemSelected += async(sender, e) =>
            {
                if (ListViewAbout.SelectedItem == null)
                {
                    return;
                }

                await NavigationService.PushAsync(Navigation, new SettingsPage());

                ListViewAbout.SelectedItem = null;
            };

            ListViewInfo.ItemSelected += async(sender, e) =>
            {
                if (!(this.ListViewInfo.SelectedItem is MenuItem item))
                {
                    return;
                }
                Page page = null;
                switch (item.Parameter)
                {
                case "sponsors":
                    page = new SponsorsPage();
                    break;
                }

                if (page == null)
                {
                    return;
                }
                if (Device.OS == TargetPlatform.iOS)
                {
                    await NavigationService.PushAsync(((Page)this.Parent.Parent).Navigation, page);
                }
                else
                {
                    await NavigationService.PushAsync(Navigation, page);
                }

                ListViewInfo.SelectedItem = null;
            };
            isRegistered = push.IsRegistered;
        }
Пример #3
0
 public ViewModelBase(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService)
 {
     Navigation        = navigationService;
     EventAggregator   = eventAggregator;
     StoreManager      = storeManager;
     Toast             = toast;
     FavoriteService   = favoriteService;
     Logger            = logger;
     SSOClient         = ssoClient;
     PushNotifications = pushNotifications;
     ReminderService   = reminderService;
     PageDialogService = pageDialogService;
     LaunchTwitter     = twitter;
 }
Пример #4
0
        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;
        }
Пример #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");
            //        }
            //    };
        }
Пример #6
0
        public VenueViewModel(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)
        {
            if (Device.OS == TargetPlatform.Android)
            {
                ToolBarItems.Add(new ToolbarItem
                {
                    Order   = ToolbarItemOrder.Secondary,
                    Text    = "Get Directions",
                    Command = NavigateCommand
                });

                if (CanMakePhoneCall)
                {
                    ToolBarItems.Add(new ToolbarItem
                    {
                        Order   = ToolbarItemOrder.Secondary,
                        Text    = "Call Hotel",
                        Command = CallCommand
                    });
                }
            }
            else if (Device.OS == TargetPlatform.iOS)
            {
                ToolBarItems.Add(new ToolbarItem
                {
                    Text    = "More",
                    Icon    = "toolbar_overflow.png",
                    Command = DelegateCommand <object> .FromAsyncHandler(async(o) =>
                    {
                        string[] items = null;
                        if (!CanMakePhoneCall)
                        {
                            items = new[] { "Get Directions" };
                        }
                        else
                        {
                            items = new[] { "Get Directions", "Call +49 (341) 4859270" };
                        }
                        var action = await PageDialogService.DisplayActionSheetAsync("Commundo Tagungshotel", "Cancel", null, items);
                        if (action == items[0])
                        {
                            NavigateCommand.Execute(null);
                        }
                        else if (items.Length > 1 && action == items[1] && CanMakePhoneCall)
                        {
                            CallCommand.Execute(null);
                        }
                    })
                });
            }
            else
            {
                ToolBarItems.Add(new ToolbarItem
                {
                    Text    = "Directions",
                    Command = NavigateCommand,
                    Icon    = "toolbar_navigate.png"
                });

                if (CanMakePhoneCall)
                {
                    ToolBarItems.Add(new ToolbarItem
                    {
                        Text    = "Call",
                        Command = CallCommand,
                        Icon    = "toolbar_call.png"
                    });
                }
            }
            var position = new Position(Latitude, Longitude);

            MapSpan = new MapSpan(position, 0.02, 0.02);
            Pins.Add(new Pin
            {
                Type     = PinType.Place,
                Address  = LocationTitle,
                Label    = EventTitle,
                Position = position
            });
        }
Пример #7
0
        public SettingsViewModel(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)
        {
            //This will be triggered wen
            Settings.PropertyChanged += async(sender, e) =>
            {
                if (e.PropertyName == "Email")
                {
                    Settings.NeedsSync = true;
                    OnPropertyChanged("LoginText");
                    OnPropertyChanged("AccountItems");
                    //if logged in you should go ahead and sync data.
                    if (Settings.IsLoggedIn)
                    {
                        await ExecuteSyncCommandAsync();
                    }
                }
            };

            AboutItems.AddRange(new[]
            {
                new Models.MenuItem {
                    Name = "Created by MyMie with love for Dev Open Space Leipzig", Command = LaunchBrowserCommand, Parameter = "https://www.mymieapp.com"
                },
                new Models.MenuItem {
                    Name = "Open source on GitHub!", Command = LaunchBrowserCommand, Parameter = "https://github.com/dersia/devopenspaceapp"
                },
                //new Models.MenuItem { Name = "Open Source Notice", Command=LaunchBrowserCommand, Parameter="http://tiny.cc/app-evolve-osn"}
            });

            TechnologyItems.AddRange(new[]
            {
                new Models.MenuItem {
                    Name = "Azure Mobile Apps", Command = LaunchBrowserCommand, Parameter = "https://github.com/Azure/azure-mobile-apps-net-client/"
                },
                new Models.MenuItem {
                    Name = "Censored", Command = LaunchBrowserCommand, Parameter = "https://github.com/jamesmontemagno/Censored"
                },
                new Models.MenuItem {
                    Name = "Calendar Plugin", Command = LaunchBrowserCommand, Parameter = "https://github.com/TheAlmightyBob/Calendars"
                },
                new Models.MenuItem {
                    Name = "Connectivity Plugin", Command = LaunchBrowserCommand, Parameter = "https://github.com/jamesmontemagno/Xamarin.Plugins/tree/master/Connectivity"
                },
                new Models.MenuItem {
                    Name = "Embedded Resource Plugin", Command = LaunchBrowserCommand, Parameter = "https://github.com/JosephHill/EmbeddedResourcePlugin"
                },
                new Models.MenuItem {
                    Name = "External Maps Plugin", Command = LaunchBrowserCommand, Parameter = "https://github.com/jamesmontemagno/Xamarin.Plugins/tree/master/ExternalMaps"
                },
                new Models.MenuItem {
                    Name = "Image Circles", Command = LaunchBrowserCommand, Parameter = "https://github.com/jamesmontemagno/Xamarin.Plugins/tree/master/ImageCircle"
                },
                new Models.MenuItem {
                    Name = "Json.NET", Command = LaunchBrowserCommand, Parameter = "https://github.com/JamesNK/Newtonsoft.Json"
                },
                new Models.MenuItem {
                    Name = "LinqToTwitter", Command = LaunchBrowserCommand, Parameter = "https://github.com/JoeMayo/LinqToTwitter"
                },
                new Models.MenuItem {
                    Name = "Messaging Plugin", Command = LaunchBrowserCommand, Parameter = "https://github.com/cjlotz/Xamarin.Plugins"
                },
                new Models.MenuItem {
                    Name = "Permissions Plugin", Command = LaunchBrowserCommand, Parameter = "https://github.com/jamesmontemagno/Xamarin.Plugins/tree/master/Permissions"
                },
                new Models.MenuItem {
                    Name = "Xamarin Evolve App", Command = LaunchBrowserCommand, Parameter = "https://github.com/xamarinhq/app-evolve"
                },
                new Models.MenuItem {
                    Name = "PCL Storage", Command = LaunchBrowserCommand, Parameter = "https://github.com/dsplaisted/PCLStorage"
                },
                new Models.MenuItem {
                    Name = "Pull to Refresh Layout", Command = LaunchBrowserCommand, Parameter = "https://github.com/jamesmontemagno/Xamarin.Forms-PullToRefreshLayout"
                },
                new Models.MenuItem {
                    Name = "Settings Plugin", Command = LaunchBrowserCommand, Parameter = "https://github.com/jamesmontemagno/Xamarin.Plugins/tree/master/Settings"
                },
                new Models.MenuItem {
                    Name = "Toolkit for Xamarin.Forms", Command = LaunchBrowserCommand, Parameter = "https://github.com/jamesmontemagno/xamarin.forms-toolkit"
                },
                new Models.MenuItem {
                    Name = "Xamarin.Forms", Command = LaunchBrowserCommand, Parameter = "http://xamarin.com/forms"
                },
                new Models.MenuItem {
                    Name = "Prism.Forms", Command = LaunchBrowserCommand, Parameter = "https://github.com/PrismLibrary/Prism"
                },
            });

            AboutItems.CollectionChanged += (sender, e) =>
            {
                AboutListHeightAdjustment = AboutItems.Count;
            };
            AboutListHeightAdjustment = AboutItems.Count;
        }
 public WorkshopDetailsViewModel(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)
 {
     EventAggregator.GetEvent <WorkshopSelectedEvent>().Subscribe(WorkshopSelected);
 }
Пример #9
0
 public EventsViewModel(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)
 {
     Title = "Events";
     if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
     {
         ToolBarItems.Add(new ToolbarItem
         {
             Text    = "Refresh",
             Icon    = "toolbar_refresh.png",
             Command = ForceRefreshCommand
         });
     }
 }
Пример #10
0
 public ReminderService(IPushNotifications pushNotificationService, IPageDialogService pageDialogService)
 {
     _pushNotificationService = pushNotificationService;
     _pageDialogService       = pageDialogService;
 }
Пример #11
0
        public TweetImageViewModel(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)
        {
            EventAggregator.GetEvent <TweetImageChangedEvent>().Subscribe(ImageChanged);
            var item = new ToolbarItem
            {
                Text    = "Done",
                Command = DelegateCommand.FromAsyncHandler(async() => await Navigation.GoBackAsync())
            };

            if (Device.OS == TargetPlatform.Android)
            {
                item.Icon = "toolbar_close.png";
            }
            ToolBarItems.Add(item);
        }
Пример #12
0
 public SponsorsViewModel(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)
 {
     if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
     {
         ToolBarItems.Add(new ToolbarItem
         {
             Text    = "Refresh",
             Icon    = "toolbar_refresh.png",
             Command = ForceRefreshCommand
         });
     }
     if (Device.OS == TargetPlatform.Android)
     {
         Effects.Add("open.conference.app.ListViewSelectionOnTopEffect");
     }
 }
Пример #13
0
 public EventDetailsViewModel(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)
 {
     Sponsors = new ObservableRangeCollection <Sponsor>();
     EventAggregator.GetEvent <EventSelectedEvent>().Subscribe(EventSelected);
 }
Пример #14
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");
                }
            };
        }
Пример #15
0
        public WorkshopsViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService, IUnityContainer container)
            : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
        {
            _container            = container;
            NextForceRefresh      = DateTime.UtcNow.AddMinutes(45);
            ShowFavoritesCategory = Settings.FavoritesOnly;
            ShowPastCategory      = Settings.ShowPastWorkshops;
            ShowAllCategory       = Settings.ShowAllCategories;
            LoggedIn           = Settings.Email;
            FilteredCategories = Settings.FilteredCategories;

            Setup();
            Workshops.CollectionChanged += (sender, args) => { OnPropertyChanged("Workshops"); };
        }
Пример #16
0
        public AboutViewModel(IDevice device)
        {
            this.DeviceName = device.Name;
            this.DeviceFirmwareVersion = device.FirmwareVersion;
            this.DeviceHardwareVersion = device.HardwareVersion;
            this.DeviceManufacturer = device.Manufacturer;

            AboutItems.Clear ();
            AboutItems.Add(new MenuItem { Name = "About this app", Icon = "icon_venue.png" });
            push = DependencyService.Get<IPushNotifications>();

            InfoItems.AddRange(new []
                {
                    new MenuItem { Name = "Sponsors", Icon = "icon_venue.png", Parameter="sponsors"},
                    new MenuItem { Name = "Evaluations", Icon = "icon_venue.png", Parameter="evaluations"},
                    new MenuItem { Name = "Venue", Icon = "icon_venue.png", Parameter = "venue"},
                    new MenuItem { Name = "Conference Floor Maps", 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 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();

            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");
                    }
                };
        }
Пример #17
0
        public AboutPage()
        {
            InitializeComponent();
            BindingContext = vm = new AboutViewModel();
            push           = DependencyService.Get <IPushNotifications>();

            var adjust = Device.OS != TargetPlatform.Android ? 1 : -vm.AboutItems.Count + 1;

            //ListViewAbout.HeightRequest = (vm.AboutItems.Count * ListViewAbout.RowHeight) - adjust;
            //ListViewAbout.ItemTapped += (sender, e) => ListViewAbout.SelectedItem = null;
            //ListViewInfo.HeightRequest = (vm.InfoItems.Count * ListViewInfo.RowHeight) - adjust;

            ListViewAccount.HeightRequest = (vm.AccountItems.Count * ListViewAccount.RowHeight) - adjust;
            ListViewAccount.ItemTapped   += (sender, e) => ListViewAccount.SelectedItem = null;;

            //ListViewAbout.ItemSelected +=  (sender, e) =>
            //    {
            //        if(ListViewAbout.SelectedItem == null)
            //            return;

            //        App.Logger.TrackPage(AppPage.Settings.ToString());
            //     // await NavigationService.PushAsync(Navigation, new SettingsPage());

            //      ListViewAbout.SelectedItem = null;
            //  };

            //ListViewInfo.ItemSelected += (sender, e) =>
            //{
            //    var item = ListViewInfo.SelectedItem as Portable.MenuItem;
            //    if (item == null)
            //        return;
            //    Page page = null;
            //    switch (item.Parameter)
            //    {
            //        case "feedback-ratings":
            //            App.Logger.TrackPage("Feedback Ratings");
            //            page = new EvaluationsPage();
            //            break;
            //        case "maps":
            //            App.Logger.TrackPage(AppPage.Venue.ToString());
            //            page = new VenuePage();
            //            break;
            //        case "sealegs-promise":
            //            App.Logger.TrackPage(AppPage.CodeOfConduct.ToString());
            //            page = new CodeOfConductPage();
            //            break;
            //        case "wi-fi":
            //            App.Logger.TrackPage(AppPage.WiFi.ToString());
            //            page = new WiFiInformationPage();
            //            break;
            //        case "news":
            //            App.Logger.TrackPage(AppPage.News.ToString());
            //            page = new NewsPage();
            //            break;
            //        case "notifications"://binny
            //             App.Logger.TrackPage(AppPage.NotificationManagement.ToString());
            //            page = new NotificationsManagmentPage();
            //            break;
            //        case "restaurant-maps":
            //            App.Logger.TrackPage(AppPage.FloorMap.ToString());
            //            page = new FloorMapsCarouselPage();
            //            break;
            //    }
            //    if (page == null)
            //        return;
            //     //if(Device.OS == TargetPlatform.iOS && page is VenuePage)
            //     //  //  await NavigationService.PushAsync(((Page)this.Parent.Parent).Navigation, page);
            //     //else
            //     //  //  await NavigationService.PushAsync(Navigation, page);

            //     ListViewInfo.SelectedItem = null;
            //};

            isRegistered = push.IsRegistered;
        }
        public FilterSessionsViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService, IUnityContainer container)
            : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
        {
            _container   = container;
            _allCategory = new open.conference.app.DataStore.Abstractions.DataObjects.Category
            {
                Name       = "All",
                IsEnabled  = true,
                IsFiltered = Settings.ShowAllCategories
            };

            _allCategory.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "IsFiltered")
                {
                    SetShowAllCategories(_allCategory.IsFiltered);
                }
            };

            ToolBarItems.Add(new ToolbarItem
            {
                Text    = "Done",
                Command = DoneCommand,
                Icon    = Device.OS != TargetPlatform.iOS ? "toolbar_close.png" : null
            });
        }
Пример #19
0
 public UWPRootViewModel(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)
 {
     SetupPages();
     _selectedMenuItem = Pages[0];
 }
Пример #20
0
 public LoginViewModel(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)
 {
     if (!Settings.FirstRun)
     {
         Title = "My Account";
         var cancel = new ToolbarItem
         {
             Text    = "Cancel",
             Command = DelegateCommand.FromAsyncHandler(async() =>
             {
                 if (IsBusy)
                 {
                     return;
                 }
                 await Finish();
                 Settings.FirstRun = false;
             }).ObservesCanExecute((arg) => IsBusy)
         };
         if (Device.OS != TargetPlatform.iOS)
         {
             cancel.Icon = "toolbar_close.png";
         }
         ToolBarItems.Add(cancel);
     }
 }
Пример #21
0
 public ConferenceInfoViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService, IWiFiConfig wifiConfig)
     : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
 {
     _wifiConfig = wifiConfig;
 }
        public PushService()
        {
            IPushNotifications hubNotification = new PushSharperNotification();

            this.pushNotification = hubNotification;
        }
Пример #23
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");
                }
            };
        }
Пример #24
0
 public iOSRootViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService, Microsoft.Practices.Unity.IUnityContainer container)
     : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService)
 {
     _container = container;
 }
Пример #25
0
 public ParallaxScrollViewModel(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)
 {
 }
Пример #26
0
        public FeedViewModel(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)
        {
            NextForceRefresh = DateTime.UtcNow.AddMinutes(45);
            if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
            {
                ToolBarItems.Add(new ToolbarItem
                {
                    Text    = "Refresh",
                    Icon    = "toolbar_refresh.png",
                    Command = RefreshCommand
                });
            }
            LoggedIn = Settings.Email;

            Tweets.CollectionChanged += (sender, e) =>
            {
                TweetListHeightAdjustment = Tweets.Count;
            };

            Sessions.CollectionChanged += (sender, e) =>
            {
                SessionListHeightAdjustment = Sessions.Count;
            };
            Workshops.CollectionChanged += (sender, e) =>
            {
                WorkshopListHeightAdjustment = Workshops.Count;
            };
        }
Пример #27
0
        public AboutPage()
        {
            InitializeComponent();
            BindingContext = vm = new AboutViewModel();
            push           = DependencyService.Get <IPushNotifications>();
            var adjust = Device.OS != TargetPlatform.Android ? 1 : -vm.AboutItems.Count + 1;

            ListViewAbout.HeightRequest = (vm.AboutItems.Count * ListViewAbout.RowHeight) - adjust;
            ListViewAbout.ItemTapped   += (sender, e) => ListViewAbout.SelectedItem = null;
            ListViewInfo.HeightRequest  = (vm.InfoItems.Count * ListViewInfo.RowHeight) - adjust;

            ListViewAccount.HeightRequest = (vm.AccountItems.Count * ListViewAccount.RowHeight) - adjust;
            ListViewAccount.ItemSelected += async(sender, e) =>
            {
                var item = ListViewAccount.SelectedItem as XamarinEvolve.Clients.Portable.MenuItem;
                if (item == null)
                {
                    return;
                }
                Page page = null;
                switch (item.Parameter)
                {
                case "mobiletowebsync":
                    page = new SyncMobileToWebPage();
                    break;

                case "webtomobilesync":
                    page = new SyncWebToMobilePage();
                    break;
                }
                ListViewAccount.SelectedItem = null;

                if (page == null)
                {
                    return;
                }

                await NavigationService.PushAsync(Navigation, page);
            };

            ListViewAbout.ItemSelected += async(sender, e) =>
            {
                if (ListViewAbout.SelectedItem == null)
                {
                    return;
                }

                await NavigationService.PushAsync(Navigation, new SettingsPage());

                ListViewAbout.SelectedItem = null;
            };

            ListViewInfo.ItemSelected += async(sender, e) =>
            {
                var item = ListViewInfo.SelectedItem as XamarinEvolve.Clients.Portable.MenuItem;
                if (item == null)
                {
                    return;
                }
                Page page = null;
                switch (item.Parameter)
                {
                case "evaluations":
                    page = new EvaluationsPage();
                    break;

                case "venue":
                    page = new VenuePage();
                    break;

                case "code-of-conduct":
                    page = new CodeOfConductPage();
                    break;

                case "wi-fi":
                    page = new WiFiInformationPage();
                    break;

                case "sponsors":
                    page = new SponsorsPage();
                    break;

                case "floor-maps":
                    App.Logger.TrackPage(AppPage.FloorMap.ToString());
                    page = new FloorMapsCarouselPage();
                    break;
                }

                if (page == null)
                {
                    return;
                }
                if (Device.OS == TargetPlatform.iOS && page is VenuePage)
                {
                    await NavigationService.PushAsync(((Page)this.Parent.Parent).Navigation, page);
                }
                else
                {
                    await NavigationService.PushAsync(Navigation, page);
                }

                ListViewInfo.SelectedItem = null;
            };
            isRegistered = push.IsRegistered;
        }
Пример #28
0
        public AboutPage(IDevice device)
        {
            InitializeComponent();
            BindingContext = vm = new AboutViewModel(device);
            push = DependencyService.Get<IPushNotifications>();
            var adjust = Device.OS != TargetPlatform.Android ? 1 : -vm.AboutItems.Count + 1;
            ListViewAbout.HeightRequest = (vm.AboutItems.Count * ListViewAbout.RowHeight) - adjust;
            ListViewAbout.ItemTapped += (sender, e) => ListViewAbout.SelectedItem = null;
            ListViewInfo.HeightRequest = (vm.InfoItems.Count * ListViewInfo.RowHeight) - adjust;

            ListViewAccount.HeightRequest = (vm.AccountItems.Count * ListViewAccount.RowHeight) - adjust;
            ListViewAccount.ItemTapped += (sender, e) => ListViewAccount.SelectedItem = null;;

            ListViewAbout.ItemSelected += async (sender, e) =>
                {
                    if(ListViewAbout.SelectedItem == null)
                        return;

                    App.Logger.TrackPage(AppPage.Settings.ToString());
                    await NavigationService.PushAsync(Navigation, new SettingsPage());

                    ListViewAbout.SelectedItem = null;
                };

            ListViewInfo.ItemSelected += async (sender, e) =>
                {
                    var item = ListViewInfo.SelectedItem as XamarinEvolve.Clients.Portable.MenuItem;
                    if(item == null)
                        return;
                    Page page = null;
                    switch(item.Parameter)
                    {
                        case "evaluations":
                            App.Logger.TrackPage ("Evaluations");
                            page = new EvaluationsPage ();
                            break;
                        case "venue":
                            App.Logger.TrackPage(AppPage.Venue.ToString());
                            page = new VenuePage();
                            break;
                        case "code-of-conduct":
                            App.Logger.TrackPage(AppPage.CodeOfConduct.ToString());
                            page = new CodeOfConductPage();
                            break;
                        case "wi-fi":
                            App.Logger.TrackPage(AppPage.WiFi.ToString());
                            page = new WiFiInformationPage();
                            break;
                        case "sponsors":
                            App.Logger.TrackPage(AppPage.Sponsors.ToString());
                            page = new SponsorsPage();
                            break;
                        case "floor-maps":
                            App.Logger.TrackPage(AppPage.FloorMap.ToString());
                            page = new FloorMapsCarouselPage();
                            break;
                    }

                    if(page == null)
                        return;
                    if(Device.OS == TargetPlatform.iOS && page is VenuePage)
                        await NavigationService.PushAsync(((Page)this.Parent.Parent).Navigation, page);
                    else
                        await NavigationService.PushAsync(Navigation, page);

                    ListViewInfo.SelectedItem = null;
                };
            isRegistered = push.IsRegistered;
        }