public CorePageView(Page rootPage, NavigationBehavior navigationBehavior = NavigationBehavior.PushAsync) { _titleToPage = _pages.ToDictionary(o => o.Title); // avoid NRE for root pages without NavigationBar if (navigationBehavior == NavigationBehavior.PushAsync && rootPage.GetType() == typeof(CoreNavigationPage)) { _pages.Add(new GalleryPageFactory(() => new NavigationBarGallery((NavigationPage)rootPage), "NavigationBar Gallery - Legacy")); } var template = new DataTemplate(typeof(TextCell)); template.SetBinding(TextCell.TextProperty, "Title"); BindingContext = _pages; ItemTemplate = template; ItemsSource = _pages; ItemSelected += async(sender, args) => { if (SelectedItem == null) { return; } var item = args.SelectedItem; var page = item as GalleryPageFactory; if (page != null) { await PushPage(page.Realize()); } SelectedItem = null; }; }
public CoreRootPage(Page rootPage, NavigationBehavior navigationBehavior = NavigationBehavior.PushAsync) { ValidateRegistrar(); IStringProvider stringProvider = DependencyService.Get <IStringProvider>(); Title = stringProvider.CoreGalleryTitle; var corePageView = new CorePageView(rootPage, navigationBehavior); var searchBar = new SearchBar() { AutomationId = "SearchBar" }; var testCasesButton = new Button { Text = "Go to Test Cases", AutomationId = "GoToTestButton", Command = new Command(async() => { if (!string.IsNullOrEmpty(searchBar.Text)) { await corePageView.PushPage(searchBar.Text); } else { await Navigation.PushModalAsync(TestCases.GetTestCases()); } }) }; var stackLayout = new StackLayout() { Children = { testCasesButton, searchBar, new Button { Text = "Click to Force GC", Command = new Command(() => { GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); }) } } }; Content = new AbsoluteLayout { Children = { { new CoreRootView(), new Rectangle(0, 0.0, 1, 0.35), AbsoluteLayoutFlags.All }, { stackLayout, new Rectangle(0, 0.5, 1, 0.30), AbsoluteLayoutFlags.All }, { corePageView, new Rectangle(0, 1.0, 1.0, 0.35), AbsoluteLayoutFlags.All }, } }; }
public IssueAttribute(IssueTracker issueTracker, int issueNumber, string description, PlatformAffected platformsAffected, NavigationBehavior navigationBehavior = NavigationBehavior.Default) { IssueTracker = issueTracker; IssueNumber = issueNumber; Description = description; PlatformsAffected = platformsAffected; NavigationBehavior = navigationBehavior; }
// Use this for initialization void Start() { initPos = gameObject.transform.localPosition; initRot = gameObject.transform.localRotation.eulerAngles; fracPosJourney = 1; fracRotJourney = 1; moving = false; NB = GameObject.Find("EventSystem").GetComponent <NavigationBehavior>(); }
public static bool TryNavigateTo(this DocumentSpan documentSpan, NavigationBehavior navigationBehavior) { var solution = documentSpan.Document.Project.Solution; var workspace = solution.Workspace; var service = workspace.Services.GetService <IDocumentNavigationService>(); var options = solution.Options.WithChangedOption(NavigationOptions.PreferProvisionalTab, navigationBehavior != NavigationBehavior.Normal); options = options.WithChangedOption(NavigationOptions.ActivateProvisionalTab, navigationBehavior == NavigationBehavior.PreviewWithFocus); return(service.TryNavigateToSpan(workspace, documentSpan.Document.Id, documentSpan.SourceSpan, options)); }
public CoreRootPage(Page rootPage, NavigationBehavior navigationBehavior = NavigationBehavior.PushAsync) { ValidateRegistrar(); var galleryFactory = DependencyService.Get<IPlatformSpecificCoreGalleryFactory>(); Title = galleryFactory?.Title ?? "Core Gallery"; var corePageView = new CorePageView(rootPage, navigationBehavior); var searchBar = new SearchBar() { AutomationId = "SearchBar" }; searchBar.TextChanged += (sender, e) => { corePageView.FilterPages(e.NewTextValue); }; var testCasesButton = new Button { Text = "Go to Test Cases", AutomationId = "GoToTestButton", TabIndex = -2, Command = new Command(async () => { if (!string.IsNullOrEmpty(searchBar.Text)) await corePageView.PushPage(searchBar.Text); else await Navigation.PushModalAsync(TestCases.GetTestCases()); }) }; var stackLayout = new StackLayout() { Children = { testCasesButton, searchBar, new Button { Text = "Click to Force GC", TabIndex = -2, Command = new Command(() => { GC.Collect (); GC.WaitForPendingFinalizers (); GC.Collect (); }) } } };
public override bool TryNavigateTo(Workspace workspace, NavigationBehavior navigationBehavior) { if (Properties.ContainsKey(NonNavigable)) { return(false); } if (Properties.TryGetValue(MetadataSymbolKey, out var symbolKey)) { return(TryNavigateToMetadataSymbol(workspace, symbolKey)); } return(SourceSpans[0].TryNavigateTo(navigationBehavior)); }
public CorePageView(Page rootPage, NavigationBehavior navigationBehavior = NavigationBehavior.PushAsync) { var galleryFactory = DependencyService.Get <IPlatformSpecificCoreGalleryFactory>(); var platformPages = galleryFactory?.GetPages(); if (platformPages != null) { _pages.AddRange(platformPages.Select(p => new GalleryPageFactory(p.Create, p.Title + " (Platform Specifc)"))); } _titleToPage = _pages.ToDictionary(o => o.Title); // avoid NRE for root pages without NavigationBar if (navigationBehavior == NavigationBehavior.PushAsync && rootPage.GetType() == typeof(CoreNavigationPage)) { _pages.Insert(0, new GalleryPageFactory(() => new NavigationBarGallery((NavigationPage)rootPage), "NavigationBar Gallery - Legacy")); _pages.Insert(1, new GalleryPageFactory(() => new TitleView(true), "TitleView")); } _pages.Sort((x, y) => string.Compare(x.Title, y.Title, true)); var template = new DataTemplate(() => { var cell = new TextCell(); cell.ContextActions.Add(new MenuItem { Text = "Select Visual", Command = new Command(async() => { var buttons = typeof(VisualMarker).GetProperties().Select(p => p.Name); var selection = await rootPage.DisplayActionSheet("Select Visual", "Cancel", null, buttons.ToArray()); if (cell.BindingContext is GalleryPageFactory pageFactory) { var page = pageFactory.Realize(); if (typeof(VisualMarker).GetProperty(selection)?.GetValue(null) is IVisual visual) { page.Visual = visual; } await PushPage(page); } }) }); return(cell); });
public CorePageView(Page rootPage, NavigationBehavior navigationBehavior = NavigationBehavior.PushAsync) { var pages = new List <Page> { new AppLinkPageGallery { Title = "App Link Page Gallery" }, new NestedNativeControlGalleryPage { Title = "Nested Native Controls Gallery" }, new CellForceUpdateSizeGalleryPage { Title = "Cell Force Update Size Gallery" }, new AppearingGalleryPage { Title = "Appearing Gallery" }, new EntryCoreGalleryPage { Title = "Entry Gallery" }, new NavBarTitleTestPage { Title = "Titles And Navbar Windows" }, new PanGestureGalleryPage { Title = "Pan gesture Gallery" }, new PinchGestureTestPage { Title = "Pinch gesture Gallery" }, new AutomationIdGallery { Title = "AutomationID Gallery" }, new LayoutPerformanceGallery { Title = "Layout Perf Gallery" }, new ListViewSelectionColor { Title = "ListView SelectionColor Gallery" }, new AlertGallery { Title = "DisplayAlert Gallery" }, new ToolbarItems { Title = "ToolbarItems Gallery" }, new ActionSheetGallery { Title = "ActionSheet Gallery" }, new ActivityIndicatorCoreGalleryPage { Title = "ActivityIndicator Gallery" }, new BehaviorsAndTriggers { Title = "BehaviorsTriggers Gallery" }, new ContextActionsGallery { Title = "ContextActions List Gallery" }, new ContextActionsGallery(tableView: true) { Title = "ContextActions Table Gallery" }, new CoreBoxViewGalleryPage { Title = "BoxView Gallery" }, new ButtonCoreGalleryPage { Title = "Button Gallery" }, new DatePickerCoreGalleryPage { Title = "DatePicker Gallery" }, new EditorCoreGalleryPage { Title = "Editor Gallery" }, new FrameCoreGalleryPage { Title = "Frame Gallery" }, new ImageCoreGalleryPage { Title = "Image Gallery" }, new KeyboardCoreGallery { Title = "Keyboard Gallery" }, new LabelCoreGalleryPage { Title = "Label Gallery" }, new ListViewCoreGalleryPage { Title = "ListView Gallery" }, new OpenGLViewCoreGalleryPage { Title = "OpenGLView Gallery" }, new PickerCoreGalleryPage { Title = "Picker Gallery" }, new ProgressBarCoreGalleryPage { Title = "ProgressBar Gallery" }, new ScrollGallery { Title = "ScrollView Gallery" }, new ScrollGallery(ScrollOrientation.Horizontal) { Title = "ScrollView Gallery Horizontal" }, new ScrollGallery(ScrollOrientation.Both) { Title = "ScrollView Gallery 2D" }, new SearchBarCoreGalleryPage { Title = "SearchBar Gallery" }, new SliderCoreGalleryPage { Title = "Slider Gallery" }, new StepperCoreGalleryPage { Title = "Stepper Gallery" }, new SwitchCoreGalleryPage { Title = "Switch Gallery" }, new TableViewCoreGalleryPage { Title = "TableView Gallery" }, new TimePickerCoreGalleryPage { Title = "TimePicker Gallery" }, new WebViewCoreGalleryPage { Title = "WebView Gallery" }, //pages new RootContentPage("Content") { Title = "RootPages Gallery" }, new MasterDetailPageTabletPage { Title = "MasterDetailPage Tablet Page" }, // legacy galleries new AbsoluteLayoutGallery { Title = "AbsoluteLayout Gallery - Legacy" }, new BoundContentPage { Title = "BoundPage Gallery - Legacy" }, new BackgroundImageGallery { Title = "BackgroundImage gallery" }, new ButtonGallery { Title = "Button Gallery - Legacy" }, new CarouselPageGallery { Title = "CarouselPage Gallery - Legacy" }, new CellTypesListPage { Title = "Cells Gallery - Legacy" }, new ClipToBoundsGallery { Title = "ClipToBounds Gallery - Legacy" }, new ControlTemplatePage { Title = "ControlTemplated Gallery - Legacy" }, new ControlTemplateXamlPage { Title = "ControlTemplated XAML Gallery - Legacy" }, new DisposeGallery { Title = "Dispose Gallery - Legacy" }, new EditorGallery { Title = "Editor Gallery - Legacy" }, new EntryGallery { Title = "Entry Gallery - Legacy" }, new FrameGallery { Title = "Frame Gallery - Legacy" }, new GridGallery { Title = "Grid Gallery - Legacy" }, new GroupedListActionsGallery { Title = "GroupedListActions Gallery - Legacy" }, new GroupedListContactsGallery { Title = "GroupedList Gallery - Legacy" }, new ImageGallery { Title = "Image Gallery - Legacy" }, new ImageLoadingGallery { Title = "ImageLoading Gallery - Legacy" }, new InputIntentGallery { Title = "InputIntent Gallery - Legacy" }, new LabelGallery { Title = "Label Gallery - Legacy" }, new LayoutAddPerformance { Title = "Layout Add Performance - Legacy" }, new LayoutOptionsGallery { Title = "LayoutOptions Gallery - Legacy" }, new LineBreakModeGallery { Title = "LineBreakMode Gallery - Legacy" }, new ListPage { Title = "ListView Gallery - Legacy" }, new ListScrollTo { Title = "ListView.ScrollTo" }, new ListRefresh { Title = "ListView.PullToRefresh" }, new ListViewDemoPage { Title = "ListView Demo Gallery - Legacy" }, new MapGallery { Title = "Map Gallery - Legacy" }, new MinimumSizeGallery { Title = "MinimumSize Gallery - Legacy" }, new MultiGallery { Title = "Multi Gallery - Legacy" }, new NavigationMenuGallery { Title = "NavigationMenu Gallery - Legacy" }, new NavigationPropertiesGallery { Title = "Navigation Properties" }, #if HAVE_OPENTK new OpenGLGallery { Title = "OpenGLGallery - Legacy" }, #endif new PickerGallery { Title = "Picker Gallery - Legacy" }, new ProgressBarGallery { Title = "ProgressBar Gallery - Legacy" }, new RelativeLayoutGallery { Title = "RelativeLayout Gallery - Legacy" }, new ScaleRotate { Title = "Scale Rotate Gallery - Legacy" }, new SearchBarGallery { Title = "SearchBar Gallery - Legacy" }, new SettingsPage { Title = "Settings Page - Legacy" }, new SliderGallery { Title = "Slider Gallery - Legacy" }, new StackLayoutGallery { Title = "StackLayout Gallery - Legacy" }, new StepperGallery { Title = "Stepper Gallery - Legacy" }, new StyleGallery { Title = "Style Gallery" }, new StyleXamlGallery { Title = "Style Gallery in Xaml" }, new SwitchGallery { Title = "Switch Gallery - Legacy" }, new TableViewGallery { Title = "TableView Gallery - Legacy" }, new TemplatedCarouselGallery { Title = "TemplatedCarouselPage Gallery - Legacy" }, new TemplatedTabbedGallery { Title = "TemplatedTabbedPage Gallery - Legacy" }, new UnevenViewCellGallery { Title = "UnevenViewCell Gallery - Legacy" }, new UnevenListGallery { Title = "UnevenList Gallery - Legacy" }, new ViewCellGallery { Title = "ViewCell Gallery - Legacy" }, new WebViewGallery { Title = "WebView Gallery - Legacy" }, }; titleToPage = pages.ToDictionary(o => o.Title); // avoid NRE for root pages without NavigationBar if (navigationBehavior == NavigationBehavior.PushAsync && rootPage.GetType() == typeof(CoreNavigationPage)) { pages.Add(new NavigationBarGallery((NavigationPage)rootPage) { Title = "NavigationBar Gallery - Legacy" }); } var template = new DataTemplate(typeof(TextCell)); template.SetBinding(TextCell.TextProperty, "Title"); BindingContext = pages; ItemTemplate = template; ItemsSource = pages; ItemSelected += async(sender, args) => { if (SelectedItem == null) { return; } var item = args.SelectedItem; var page = item as Page; if (page != null) { await PushPage(page); } SelectedItem = null; }; }
public abstract bool TryNavigateTo(Workspace workspace, NavigationBehavior navigationBehavior);
protected virtual void HandlePageEndKey(KeyEventArgs e) { if (e.Handled) { return; } DataGridContext dataGridContext = null; if (e.OriginalSource != null) { dataGridContext = DataGridControl.GetDataGridContext(e.OriginalSource as DependencyObject); } else { dataGridContext = DataGridControl.GetDataGridContext(this); } if (dataGridContext == null) { return; } PagingBehavior pagingBehavior = dataGridContext.DataGridControl.PagingBehavior; NavigationBehavior navigationBehavior = dataGridContext.DataGridControl.NavigationBehavior; ColumnBase CurrentColumn = dataGridContext.CurrentColumn; if (((navigationBehavior == NavigationBehavior.CellOnly) || (navigationBehavior == NavigationBehavior.RowOrCell)) && (CurrentColumn != null)) { int oldCurrentIndex = CurrentColumn.Index; NavigationHelper.MoveFocusToLastVisibleColumn(dataGridContext); //if the last focusable column is is within the viewport, scroll to Extended offset, otherwise, bringIntoView if ((this.IsCellsOffsetNeedReset(dataGridContext)) && (oldCurrentIndex == CurrentColumn.Index)) { this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(this.ScrollToRightEnd)); } if ((e.KeyboardDevice.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) { if (pagingBehavior == PagingBehavior.TopToBottom) { this.ScrollToBottom(); } else { this.ScrollToRightEnd(); } this.HandlePageDownNavigation(); } } else { if ((e.KeyboardDevice.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) { this.ScrollToBottom(); this.ScrollToRightEnd(); // Than handle new selection! if (navigationBehavior != NavigationBehavior.None) { this.HandlePageDownNavigation(); } } else { if (pagingBehavior == PagingBehavior.TopToBottom) { this.ScrollToRightEnd(); } else { this.ScrollToBottom(); } } } e.Handled = true; }
protected virtual void HandlePageHomeKey(KeyEventArgs e) { if (e.Handled) { return; } DataGridContext dataGridContext = null; if (e.OriginalSource != null) { dataGridContext = DataGridControl.GetDataGridContext(e.OriginalSource as DependencyObject); } else { dataGridContext = DataGridControl.GetDataGridContext(this); } if (dataGridContext == null) { return; } PagingBehavior pagingBehavior = dataGridContext.DataGridControl.PagingBehavior; NavigationBehavior navigationBehavior = dataGridContext.DataGridControl.NavigationBehavior; ColumnBase currentColumn = dataGridContext.CurrentColumn; if (((navigationBehavior == NavigationBehavior.CellOnly) || (navigationBehavior == NavigationBehavior.RowOrCell)) && (currentColumn != null)) { int oldCurrentIndex = currentColumn.Index; NavigationHelper.MoveFocusToFirstVisibleColumn(dataGridContext); var columnVirtualizationManager = dataGridContext.ColumnVirtualizationManager as TableViewColumnVirtualizationManagerBase; //if the first focusable column is is within the viewport, scroll so 0d offset, otherwise, bringIntoView bool isFixedColumn = (columnVirtualizationManager == null) ? false : columnVirtualizationManager.GetFixedFieldNames().Contains(currentColumn.FieldName); if (((this.IsCellsOffsetNeedReset(dataGridContext)) && (oldCurrentIndex == currentColumn.Index)) || (isFixedColumn)) { this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(this.ScrollToLeftEnd)); } if ((e.KeyboardDevice.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) { if (pagingBehavior == PagingBehavior.TopToBottom) { this.ScrollToTop(); } else { this.ScrollToLeftEnd(); } this.HandlePageUpNavigation(); } } else { if ((e.KeyboardDevice.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) { this.ScrollToTop(); this.ScrollToLeftEnd(); //than handle new selection! if (navigationBehavior != NavigationBehavior.None) { this.HandlePageUpNavigation(); } } else { if (pagingBehavior == PagingBehavior.TopToBottom) { this.ScrollToLeftEnd(); } else { this.ScrollToTop(); } } } e.Handled = true; }
protected virtual void HandlePageDownKey(KeyEventArgs e) { if (e.Handled) { return; } DataGridContext dataGridContext = null; if (e.OriginalSource != null) { dataGridContext = DataGridControl.GetDataGridContext(e.OriginalSource as DependencyObject); } else { dataGridContext = DataGridControl.GetDataGridContext(this); } if (dataGridContext == null) { return; } DataGridControl dataGridControl = dataGridContext.DataGridControl; PagingBehavior pagingBehavior = dataGridControl.PagingBehavior; NavigationBehavior navigationBehavior = dataGridControl.NavigationBehavior; // If the Ctrl Modifier was held at the same time if ((e.KeyboardDevice.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) { // Scroll to absolute end of the scroll viewer if (pagingBehavior == PagingBehavior.TopToBottom) { this.ScrollToBottom(); } else { this.ScrollToRightEnd(); } // Then handle new selection! if (navigationBehavior != NavigationBehavior.None) { this.HandlePageDownNavigation(); } } //No special modifiers were held else { FrameworkElement lastVisibleContainer = ScrollViewerHelper.GetLastVisibleContainer( dataGridControl, dataGridControl.ItemsHost, this); if (lastVisibleContainer != null) { // There is an identified weakness with the IsKeyboardFocusWithin property where // it cannot tell if the focus is within a Popup which is within the element // This has been identified, and only the places where it caused problems // were fixed... This comment is only here to remind developpers of the flaw // If the item has keyboard focus if ((lastVisibleContainer.IsKeyboardFocusWithin) || (lastVisibleContainer.IsKeyboardFocused) || (navigationBehavior == NavigationBehavior.None)) { // Then scroll if (pagingBehavior == PagingBehavior.TopToBottom) { this.PageDown(); } else { this.PageRight(); } } //and process new selection if (navigationBehavior != NavigationBehavior.None) { this.HandlePageDownNavigation(); } } else { // Normaly for when we are in dataGridControl.NavigationBehavior == NavigationBehavior.None if (pagingBehavior == PagingBehavior.TopToBottom) { this.PageDown(); } else { this.PageRight(); } } } e.Handled = true; }
public CoreRootPage (Page rootPage, NavigationBehavior navigationBehavior = NavigationBehavior.PushAsync) { IStringProvider stringProvider = DependencyService.Get<IStringProvider> (); Title = stringProvider.CoreGalleryTitle; var corePageView = new CorePageView (rootPage, navigationBehavior); var searchBar = new SearchBar () { AutomationId = "SearchBar" }; var testCasesButton = new Button { Text = "Go to Test Cases", AutomationId = "GoToTestButton", Command = new Command (async () => { if (!string.IsNullOrEmpty (searchBar.Text)) await corePageView.PushPage (searchBar.Text); else await Navigation.PushModalAsync (TestCases.GetTestCases ()); }) }; var stackLayout = new StackLayout () { Children = { testCasesButton, searchBar, new Button { Text = "Click to Force GC", Command = new Command(() => { GC.Collect (); GC.WaitForPendingFinalizers (); GC.Collect (); }) } } }; Content = new AbsoluteLayout { Children = { { new CoreRootView (), new Rectangle(0, 0.0, 1, 0.35), AbsoluteLayoutFlags.All }, { stackLayout, new Rectangle(0, 0.5, 1, 0.30), AbsoluteLayoutFlags.All }, { corePageView, new Rectangle(0, 1.0, 1.0, 0.35), AbsoluteLayoutFlags.All }, } }; }
public CorePageView (Page rootPage, NavigationBehavior navigationBehavior = NavigationBehavior.PushAsync) { var pages = new List<Page> { new AppLinkPageGallery {Title = "App Link Page Gallery"}, new NestedNativeControlGalleryPage {Title = "Nested Native Controls Gallery"}, new CellForceUpdateSizeGalleryPage {Title = "Cell Force Update Size Gallery"}, new AppearingGalleryPage {Title = "Appearing Gallery"}, new EntryCoreGalleryPage { Title = "Entry Gallery" }, new NavBarTitleTestPage {Title = "Titles And Navbar Windows"}, new PanGestureGalleryPage {Title = "Pan gesture Gallery"}, new PinchGestureTestPage {Title = "Pinch gesture Gallery"}, new AutomationIdGallery { Title ="AutomationID Gallery" }, new LayoutPerformanceGallery {Title = "Layout Perf Gallery"}, new ListViewSelectionColor { Title = "ListView SelectionColor Gallery" }, new AlertGallery { Title = "DisplayAlert Gallery" }, new ToolbarItems { Title = "ToolbarItems Gallery" }, new ActionSheetGallery { Title = "ActionSheet Gallery" }, new ActivityIndicatorCoreGalleryPage { Title = "ActivityIndicator Gallery" }, new BehaviorsAndTriggers { Title = "BehaviorsTriggers Gallery" }, new ContextActionsGallery { Title = "ContextActions List Gallery"}, new ContextActionsGallery (tableView: true) { Title = "ContextActions Table Gallery"}, new CoreBoxViewGalleryPage { Title = "BoxView Gallery" }, new ButtonCoreGalleryPage { Title = "Button Gallery" }, new DatePickerCoreGalleryPage { Title = "DatePicker Gallery" }, new EditorCoreGalleryPage { Title = "Editor Gallery" }, new FrameCoreGalleryPage { Title = "Frame Gallery" }, new ImageCoreGalleryPage { Title = "Image Gallery" }, new KeyboardCoreGallery { Title = "Keyboard Gallery" }, new LabelCoreGalleryPage { Title = "Label Gallery" }, new ListViewCoreGalleryPage { Title = "ListView Gallery" }, new OpenGLViewCoreGalleryPage { Title = "OpenGLView Gallery" }, new PickerCoreGalleryPage { Title = "Picker Gallery" }, new ProgressBarCoreGalleryPage { Title = "ProgressBar Gallery" }, new ScrollGallery { Title = "ScrollView Gallery" }, new ScrollGallery(ScrollOrientation.Horizontal) { Title = "ScrollView Gallery Horizontal" }, new ScrollGallery(ScrollOrientation.Both) { Title = "ScrollView Gallery 2D" }, new SearchBarCoreGalleryPage { Title = "SearchBar Gallery" }, new SliderCoreGalleryPage { Title = "Slider Gallery" }, new StepperCoreGalleryPage { Title = "Stepper Gallery" }, new SwitchCoreGalleryPage { Title = "Switch Gallery" }, new TableViewCoreGalleryPage { Title = "TableView Gallery" }, new TimePickerCoreGalleryPage { Title = "TimePicker Gallery" }, new WebViewCoreGalleryPage { Title = "WebView Gallery" }, //pages new RootContentPage ("Content") { Title = "RootPages Gallery" }, new MasterDetailPageTabletPage { Title = "MasterDetailPage Tablet Page" }, // legacy galleries new AbsoluteLayoutGallery { Title = "AbsoluteLayout Gallery - Legacy" }, new BoundContentPage { Title = "BoundPage Gallery - Legacy" }, new BackgroundImageGallery { Title = "BackgroundImage gallery" }, new ButtonGallery { Title = "Button Gallery - Legacy" }, new CarouselPageGallery { Title = "CarouselPage Gallery - Legacy" }, new CellTypesListPage { Title = "Cells Gallery - Legacy" }, new ClipToBoundsGallery { Title = "ClipToBounds Gallery - Legacy" }, new ControlTemplatePage { Title = "ControlTemplated Gallery - Legacy" }, new ControlTemplateXamlPage { Title = "ControlTemplated XAML Gallery - Legacy" }, new DisposeGallery { Title = "Dispose Gallery - Legacy" }, new EditorGallery { Title = "Editor Gallery - Legacy" }, new EntryGallery { Title = "Entry Gallery - Legacy" }, new FrameGallery { Title = "Frame Gallery - Legacy" }, new GridGallery { Title = "Grid Gallery - Legacy" }, new GroupedListActionsGallery { Title = "GroupedListActions Gallery - Legacy" }, new GroupedListContactsGallery { Title = "GroupedList Gallery - Legacy" }, new ImageGallery { Title = "Image Gallery - Legacy" }, new ImageLoadingGallery { Title = "ImageLoading Gallery - Legacy" }, new InputIntentGallery { Title = "InputIntent Gallery - Legacy" }, new LabelGallery { Title = "Label Gallery - Legacy" }, new LayoutAddPerformance { Title = "Layout Add Performance - Legacy" }, new LayoutOptionsGallery { Title = "LayoutOptions Gallery - Legacy" }, new LineBreakModeGallery { Title = "LineBreakMode Gallery - Legacy" }, new ListPage { Title = "ListView Gallery - Legacy" }, new ListScrollTo { Title = "ListView.ScrollTo" }, new ListRefresh { Title = "ListView.PullToRefresh" }, new ListViewDemoPage { Title = "ListView Demo Gallery - Legacy" }, new MapGallery { Title = "Map Gallery - Legacy" }, new MinimumSizeGallery { Title = "MinimumSize Gallery - Legacy" }, new MultiGallery { Title = "Multi Gallery - Legacy" }, new NavigationMenuGallery { Title = "NavigationMenu Gallery - Legacy" }, new NavigationPropertiesGallery { Title = "Navigation Properties" }, #if HAVE_OPENTK new OpenGLGallery { Title = "OpenGLGallery - Legacy" }, #endif new PickerGallery {Title = "Picker Gallery - Legacy"}, new ProgressBarGallery { Title = "ProgressBar Gallery - Legacy" }, new RelativeLayoutGallery { Title = "RelativeLayout Gallery - Legacy" }, new ScaleRotate { Title = "Scale Rotate Gallery - Legacy" }, new SearchBarGallery { Title = "SearchBar Gallery - Legacy" }, new SettingsPage { Title = "Settings Page - Legacy" }, new SliderGallery { Title = "Slider Gallery - Legacy" }, new StackLayoutGallery { Title = "StackLayout Gallery - Legacy" }, new StepperGallery { Title = "Stepper Gallery - Legacy" }, new StyleGallery {Title = "Style Gallery"}, new StyleXamlGallery {Title = "Style Gallery in Xaml"}, new SwitchGallery { Title = "Switch Gallery - Legacy" }, new TableViewGallery { Title = "TableView Gallery - Legacy" }, new TemplatedCarouselGallery { Title = "TemplatedCarouselPage Gallery - Legacy" }, new TemplatedTabbedGallery { Title = "TemplatedTabbedPage Gallery - Legacy" }, new UnevenViewCellGallery { Title = "UnevenViewCell Gallery - Legacy" }, new UnevenListGallery { Title = "UnevenList Gallery - Legacy" }, new ViewCellGallery { Title = "ViewCell Gallery - Legacy" }, new WebViewGallery {Title = "WebView Gallery - Legacy"}, }; titleToPage = pages.ToDictionary (o => o.Title); // avoid NRE for root pages without NavigationBar if (navigationBehavior == NavigationBehavior.PushAsync && rootPage.GetType () == typeof (CoreNavigationPage)) { pages.Add (new NavigationBarGallery ((NavigationPage)rootPage) { Title = "NavigationBar Gallery - Legacy" }); } var template = new DataTemplate (typeof(TextCell)); template.SetBinding (TextCell.TextProperty, "Title"); BindingContext = pages; ItemTemplate = template; ItemsSource = pages; ItemSelected += async (sender, args) => { if (SelectedItem == null) return; var item = args.SelectedItem; var page = item as Page; if (page != null) await PushPage (page); SelectedItem = null; }; }
public async Task GoAsync <ViewModel>(NavigationParameters parameters = null, NavigationBehavior navigationBehavior = NavigationBehavior.Default) { var newInstacePage = CreateNewInstacePage <ViewModel>(parameters); if (navigationBehavior == NavigationBehavior.ClearBackstak) { this.ClearBackstak(newInstacePage); } else { await CurrentPage.Navigation.PushAsync(newInstacePage); } }