-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update example to show how to do navigation with tabbed pages #66
Conversation
08-TabbedNavigation/src/PrismSample/ViewModels/MainPageViewModel.cs
Outdated
Show resolved
Hide resolved
08-TabbedNavigation/src/PrismSample/ViewModels/MainPageViewModel.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In thinking more about this. This is a good start but this really needs a couple of changes.
- We need to show
IInitialize
andINavigationAware
across each of the ViewModels. Each one should set a different property from the Navigation Parameters - We need to show the use of the SelectTab extension to programmatically switch tabs
08-TabbedNavigation/src/PrismSample/ViewModels/MainPageViewModel.cs
Outdated
Show resolved
Hide resolved
|
xmlns:prism="http://prismlibrary.com" | ||
prism:ViewModelLocator.AutowireViewModel="True" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the ViewModelLocator.AutowireViewModel property as it is not needed here.
08-TabbedNavigation/src/PrismSample/ViewModels/TabCPageViewModel.cs
Outdated
Show resolved
Hide resolved
$"?{KnownNavigationParameters.CreateTab}=TabCPage" + | ||
$"&{KnownNavigationParameters.CreateTab}=TabBPage" + | ||
$"&{KnownNavigationParameters.CreateTab}=TabAPage"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// KnowNavigationParameters.CreateTab == createTab
createTab=TabCPage&createTab=TabBPage
var p = new NavigationParameters(); | ||
p.Add("ActiveCount", 0); | ||
|
||
await _navigationService.NavigateAsync("TabsPage?selectedTab=TabBPage", p); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a comment:
// await _navigationService.NavigateAsync("TabsPage?selectedTab=TabBPage", ("ActiveCount", 0));
public TabsPageViewModel() | ||
{ | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a Title property... and be sure to wrap this page in a NavigationPage
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:prism="http://prismlibrary.com" | ||
xmlns:views="clr-namespace:PrismSample.Views;assembly=PrismSample" | ||
x:Class="PrismSample.Views.TabsPage"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll want to bind a the Title to the ViewModel
Considering t here's nothing at all in the master branch can we have this to just have something? Even if it's not perfect? |
Closing as requested changes have not been made in a timely manner |
closes #52
This example shows the following
Creating a tab page in xaml and navigating to a tab with the query string
Create tabs at runtime with the query string
Navigating to a tab via the querystring
Changing to another tab with the navigation service