コード例 #1
0
        public SessionDetailsPage(Session session)
        {
            InitializeComponent();

            _extension = DependencyService.Get <IPlatformSpecificExtension <Session> >();

            ItemId = session?.Title;

            FavoriteButtonAndroid.Clicked += (sender, e) => {
                Device.BeginInvokeOnMainThread(() => FavoriteIconAndroid.Grow());
            };
            FavoriteButtoniOS.Clicked += (sender, e) => {
                Device.BeginInvokeOnMainThread(() => FavoriteIconiOS.Grow());
            };

            ListViewSpeakers.ItemSelected += async(sender, e) =>
            {
                var speaker = ListViewSpeakers.SelectedItem as Speaker;
                if (speaker == null)
                {
                    return;
                }

                ContentPage destination;

                if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
                {
                    var speakerDetailsUwp = new SpeakerDetailsPageUWP(vm.Session.Id);
                    speakerDetailsUwp.Speaker = speaker;
                    destination = speakerDetailsUwp;
                }
                else
                {
                    var speakerDetails = new SpeakerDetailsPage(vm.Session.Id);
                    speakerDetails.Speaker = speaker;
                    destination            = speakerDetails;
                }

                await NavigationService.PushAsync(Navigation, destination);

                ListViewSpeakers.SelectedItem = null;
            };


            ButtonRate.Clicked += async(sender, e) =>
            {
                if (!Settings.Current.IsLoggedIn)
                {
                    MessagingService.Current.SendMessage(MessageKeys.NavigateLogin);
                    return;
                }
                await NavigationService.PushModalAsync(Navigation, new EvolveNavigationPage(new FeedbackPage(ViewModel.Session)));
            };
            BindingContext = new SessionDetailsViewModel(Navigation, session);
            ViewModel.LoadSessionCommand.Execute(null);
        }
コード例 #2
0
ファイル: RootPage.cs プロジェクト: radiantspace/App
        async Task GoToDeepLink()
        {
            if (page == null)
            {
                return;
            }
            var p  = page.Page;
            var id = page.Id;

            page = null;
            switch (p)
            {
            case AppPage.Session:
                await NavigateAsync((int)AppPage.Sessions);

                var session = await DependencyService.Get <ISessionStore>().GetAppIndexSession(id);

                if (session == null)
                {
                    break;
                }
                await Detail.Navigation.PushAsync(new SessionDetailsPage(session));

                break;

            case AppPage.Speaker:
                await NavigateAsync((int)AppPage.Speakers);

                var speaker = await DependencyService.Get <ISpeakerStore>().GetAppIndexSpeaker(id);

                if (speaker == null)
                {
                    break;
                }

                ContentPage destination;
                if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
                {
                    destination = new SpeakerDetailsPageUWP(speaker);
                }
                else
                {
                    destination = new SpeakerDetailsPage(speaker);
                }
                await Detail.Navigation.PushAsync(destination);

                break;
            }
        }
コード例 #3
0
        public SessionDetailsPage(Session session)
        {
            InitializeComponent();

            _extension = DependencyService.Get <IPlatformSpecificExtension <Session> >();

            ItemId = session?.Title;

            ListViewSpeakers.ItemSelected += async(sender, e) =>
            {
                var speaker = ListViewSpeakers.SelectedItem as Speaker;
                if (speaker == null)
                {
                    return;
                }

                ContentPage destination;

                if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
                {
                    var speakerDetailsUwp = new SpeakerDetailsPageUWP(vm.Session.Id);
                    speakerDetailsUwp.Speaker = speaker;
                    destination = speakerDetailsUwp;
                }
                else
                {
                    var speakerDetails = new SpeakerDetailsPage(vm.Session.Id);
                    speakerDetails.Speaker = speaker;
                    destination            = speakerDetails;
                }

                await NavigationService.PushAsync(Navigation, destination);

                ListViewSpeakers.SelectedItem = null;
            };


            ButtonRate.Clicked += async(sender, e) =>
            {
                await NavigationService.PushModalAsync(
                    Navigation,
                    new EvolveNavigationPage(new FeedbackPage(ViewModel.Session)));
            };
            BindingContext = new SessionDetailsViewModel(Navigation, session);
            ViewModel.LoadSessionCommand.Execute(null);
        }
コード例 #4
0
        public SpeakersPage()
        {
            InitializeComponent();
            BindingContext = new SpeakersViewModel(Navigation);

            if (Device.OS == TargetPlatform.Android)
            {
                ListViewSpeakers.Effects.Add(Effect.Resolve("Xpirit.ListViewSelectionOnTopEffect"));
            }

            if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
            {
                ToolbarItems.Add(new ToolbarItem
                {
                    Text    = "Refresh",
                    Icon    = "toolbar_refresh.png",
                    Command = ViewModel.ForceRefreshCommand
                });
            }
            ListViewSpeakers.ItemSelected += async(sender, e) =>
            {
                var speaker = ListViewSpeakers.SelectedItem as Speaker;
                if (speaker == null)
                {
                    return;
                }

                ContentPage destination;

                if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
                {
                    destination = new SpeakerDetailsPageUWP(speaker);
                }
                else
                {
                    destination = new SpeakerDetailsPage(speaker);
                }

                await NavigationService.PushAsync(Navigation, destination);

                ListViewSpeakers.SelectedItem = null;
            };
        }
コード例 #5
0
ファイル: RootPageiOS.cs プロジェクト: Peruzal/app-evolve
        public RootPageiOS()
        {
            #if ENABLE_TEST_CLOUD
            if (Settings.Current.Email == "*****@*****.**")
            {
                Settings.Current.FirstRun  = true;
                Settings.Current.FirstName = string.Empty;
                Settings.Current.LastName  = string.Empty;
                Settings.Current.Email     = string.Empty;
            }
            #endif

            NavigationPage.SetHasNavigationBar(this, false);
            Children.Add(new EvolveNavigationPage(new FeedPage()));
            Children.Add(new EvolveNavigationPage(new SessionsPage()));
            if (FeatureFlags.SpeakersEnabled)
            {
                Children.Add(new EvolveNavigationPage(new SpeakersPage()));
            }
            if (FeatureFlags.EventsEnabled)
            {
                Children.Add(new EvolveNavigationPage(new EventsPage()));
            }
            if (FeatureFlags.SponsorsOnTabPage)
            {
                Children.Add(new EvolveNavigationPage(new SponsorsPage()));
            }
            if (FeatureFlags.MiniHacksEnabled)
            {
                Children.Add(new EvolveNavigationPage(new MiniHacksPage()));
            }
            Children.Add(new EvolveNavigationPage(new AboutPage()));

            MessagingService.Current.Subscribe <DeepLinkPage>("DeepLinkPage", async(m, p) =>
            {
                switch (p.Page)
                {
                case AppPage.Notification:
                    Navigate(AppPage.Feed);
                    Navigate(AppPage.Notification);
                    await CurrentPage.Navigation.PopToRootAsync();
                    await CurrentPage.Navigation.PushAsync(new NotificationsPage());
                    break;

                case AppPage.Events:
                    Navigate(AppPage.Events);
                    await CurrentPage.Navigation.PopToRootAsync();
                    break;

                case AppPage.MiniHacks:
                    Navigate(AppPage.MiniHacks);
                    await CurrentPage.Navigation.PopToRootAsync();
                    break;

                case AppPage.MiniHack:
                    Navigate(AppPage.MiniHacks);
                    await CurrentPage.Navigation.PopToRootAsync();

                    var hack = await DependencyService.Get <IMiniHacksStore>().GetAppIndexMiniHack(p.Id);
                    if (hack == null)
                    {
                        break;
                    }

                    await CurrentPage.Navigation.PushAsync(new MiniHacksDetailsPage(hack));
                    break;

                case AppPage.Session:
                    Navigate(AppPage.Sessions);
                    await CurrentPage.Navigation.PopToRootAsync();
                    var session = await DependencyService.Get <ISessionStore>().GetAppIndexSession(p.Id);
                    if (session == null)
                    {
                        break;
                    }
                    await CurrentPage.Navigation.PushAsync(new SessionDetailsPage(session));
                    break;

                case AppPage.Speaker:
                    Navigate(AppPage.Speakers);
                    await CurrentPage.Navigation.PopToRootAsync();
                    var speaker = await DependencyService.Get <ISpeakerStore>().GetAppIndexSpeaker(p.Id);
                    if (speaker == null)
                    {
                        break;
                    }

                    ContentPage destination;
                    if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
                    {
                        destination = new SpeakerDetailsPageUWP(speaker);
                    }
                    else
                    {
                        destination = new SpeakerDetailsPage(speaker);
                    }
                    await CurrentPage.Navigation.PushAsync(destination);
                    break;
                }
            });
        }
コード例 #6
0
        public RootPageiOS()
        {
            NavigationPage.SetHasNavigationBar(this, false);
            Children.Add(new EvolveNavigationPage(new FeedPage()));
            Children.Add(new EvolveNavigationPage(new SpeakersPage()));

            Children.Add(new EvolveNavigationPage(new EventsPage()));
            if (FeatureFlags.SponsorsOnTabPage)
            {
                Children.Add(new EvolveNavigationPage(new SponsorsPage()));
            }
            Children.Add(new EvolveNavigationPage(new AboutPage()));

            MessagingService.Current.Subscribe <DeepLinkPage>(
                "DeepLinkPage",
                async(m, p) =>
            {
                switch (p.Page)
                {
                case AppPage.Notification:
                    Navigate(AppPage.Feed);
                    Navigate(AppPage.Notification);
                    await CurrentPage.Navigation.PopToRootAsync();
                    await CurrentPage.Navigation.PushAsync(new NotificationsPage());
                    break;

                case AppPage.Events:
                    Navigate(AppPage.Events);
                    await CurrentPage.Navigation.PopToRootAsync();
                    break;

                case AppPage.Session:
                    Navigate(AppPage.Sessions);
                    await CurrentPage.Navigation.PopToRootAsync();
                    var session = await DependencyService.Get <ISessionStore>().GetAppIndexSession(p.Id);
                    if (session == null)
                    {
                        break;
                    }
                    await CurrentPage.Navigation.PushAsync(new SessionDetailsPage(session));
                    break;

                case AppPage.Speaker:
                    Navigate(AppPage.Speakers);
                    await CurrentPage.Navigation.PopToRootAsync();
                    var speaker = await DependencyService.Get <ISpeakerStore>().GetAppIndexSpeaker(p.Id);
                    if (speaker == null)
                    {
                        break;
                    }

                    ContentPage destination;
                    if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
                    {
                        destination = new SpeakerDetailsPageUWP(speaker);
                    }
                    else
                    {
                        destination = new SpeakerDetailsPage(speaker);
                    }
                    await CurrentPage.Navigation.PushAsync(destination);
                    break;
                }
            });
        }