Xamarin Forms Prism : Issue with Deeplinking, navigating to another tab and opening a page












1















In my xamarin forms application,
I have a tabbed page and on a button click event of Tab1 I want to open a page on a different tab say Tab2. For that I'm using the following code:



VIEWMODEL -- Not Working



      private async Task NavigatePage()
{
Device.BeginInvokeOnMainThread(async () => {
await _navigationService.NavigateAsync("MainPage?selectedTab=Tab2Page/TargetPage");
});
}//This returns a blank page


Works



    private async Task TryNavigating()
{
Device.BeginInvokeOnMainThread(async () =>
{
await _navigationService.NavigateAsync("/NavigationPage/MainPage?selectedTab=Tab2Page/TargetPage");
});
}


NavigatePage() opens the selected tab(Tab2Page) but unable to navigate to TargetPage but instead displays white screen, where as TryNavigating() opens the selected tab and goes to Tab2Page but if you navigate back you will see extra navigation bar on top of selected tab which I don't want to display.



Can anyone please help? Am i not using the navigation service the right way or is there issue with the way I'm navigating?










share|improve this question

























  • If you want to navigate to one page in TabPage, you can take a look the TabPage with NavigationPage [developer.xamarin.com/samples/xamarin-forms/Navigation/…

    – Cherry Bu
    Nov 19 '18 at 9:54













  • It is regular tab navigation. My question is when you are already on one tab and when you click on a button on that tab you have to open new page on different tab.

    – TheDeveloper
    Nov 19 '18 at 16:19
















1















In my xamarin forms application,
I have a tabbed page and on a button click event of Tab1 I want to open a page on a different tab say Tab2. For that I'm using the following code:



VIEWMODEL -- Not Working



      private async Task NavigatePage()
{
Device.BeginInvokeOnMainThread(async () => {
await _navigationService.NavigateAsync("MainPage?selectedTab=Tab2Page/TargetPage");
});
}//This returns a blank page


Works



    private async Task TryNavigating()
{
Device.BeginInvokeOnMainThread(async () =>
{
await _navigationService.NavigateAsync("/NavigationPage/MainPage?selectedTab=Tab2Page/TargetPage");
});
}


NavigatePage() opens the selected tab(Tab2Page) but unable to navigate to TargetPage but instead displays white screen, where as TryNavigating() opens the selected tab and goes to Tab2Page but if you navigate back you will see extra navigation bar on top of selected tab which I don't want to display.



Can anyone please help? Am i not using the navigation service the right way or is there issue with the way I'm navigating?










share|improve this question

























  • If you want to navigate to one page in TabPage, you can take a look the TabPage with NavigationPage [developer.xamarin.com/samples/xamarin-forms/Navigation/…

    – Cherry Bu
    Nov 19 '18 at 9:54













  • It is regular tab navigation. My question is when you are already on one tab and when you click on a button on that tab you have to open new page on different tab.

    – TheDeveloper
    Nov 19 '18 at 16:19














1












1








1








In my xamarin forms application,
I have a tabbed page and on a button click event of Tab1 I want to open a page on a different tab say Tab2. For that I'm using the following code:



VIEWMODEL -- Not Working



      private async Task NavigatePage()
{
Device.BeginInvokeOnMainThread(async () => {
await _navigationService.NavigateAsync("MainPage?selectedTab=Tab2Page/TargetPage");
});
}//This returns a blank page


Works



    private async Task TryNavigating()
{
Device.BeginInvokeOnMainThread(async () =>
{
await _navigationService.NavigateAsync("/NavigationPage/MainPage?selectedTab=Tab2Page/TargetPage");
});
}


NavigatePage() opens the selected tab(Tab2Page) but unable to navigate to TargetPage but instead displays white screen, where as TryNavigating() opens the selected tab and goes to Tab2Page but if you navigate back you will see extra navigation bar on top of selected tab which I don't want to display.



Can anyone please help? Am i not using the navigation service the right way or is there issue with the way I'm navigating?










share|improve this question
















In my xamarin forms application,
I have a tabbed page and on a button click event of Tab1 I want to open a page on a different tab say Tab2. For that I'm using the following code:



VIEWMODEL -- Not Working



      private async Task NavigatePage()
{
Device.BeginInvokeOnMainThread(async () => {
await _navigationService.NavigateAsync("MainPage?selectedTab=Tab2Page/TargetPage");
});
}//This returns a blank page


Works



    private async Task TryNavigating()
{
Device.BeginInvokeOnMainThread(async () =>
{
await _navigationService.NavigateAsync("/NavigationPage/MainPage?selectedTab=Tab2Page/TargetPage");
});
}


NavigatePage() opens the selected tab(Tab2Page) but unable to navigate to TargetPage but instead displays white screen, where as TryNavigating() opens the selected tab and goes to Tab2Page but if you navigate back you will see extra navigation bar on top of selected tab which I don't want to display.



Can anyone please help? Am i not using the navigation service the right way or is there issue with the way I'm navigating?







xamarin xamarin.forms prism






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 4:36







TheDeveloper

















asked Nov 16 '18 at 2:08









TheDeveloperTheDeveloper

378524




378524













  • If you want to navigate to one page in TabPage, you can take a look the TabPage with NavigationPage [developer.xamarin.com/samples/xamarin-forms/Navigation/…

    – Cherry Bu
    Nov 19 '18 at 9:54













  • It is regular tab navigation. My question is when you are already on one tab and when you click on a button on that tab you have to open new page on different tab.

    – TheDeveloper
    Nov 19 '18 at 16:19



















  • If you want to navigate to one page in TabPage, you can take a look the TabPage with NavigationPage [developer.xamarin.com/samples/xamarin-forms/Navigation/…

    – Cherry Bu
    Nov 19 '18 at 9:54













  • It is regular tab navigation. My question is when you are already on one tab and when you click on a button on that tab you have to open new page on different tab.

    – TheDeveloper
    Nov 19 '18 at 16:19

















If you want to navigate to one page in TabPage, you can take a look the TabPage with NavigationPage [developer.xamarin.com/samples/xamarin-forms/Navigation/…

– Cherry Bu
Nov 19 '18 at 9:54







If you want to navigate to one page in TabPage, you can take a look the TabPage with NavigationPage [developer.xamarin.com/samples/xamarin-forms/Navigation/…

– Cherry Bu
Nov 19 '18 at 9:54















It is regular tab navigation. My question is when you are already on one tab and when you click on a button on that tab you have to open new page on different tab.

– TheDeveloper
Nov 19 '18 at 16:19





It is regular tab navigation. My question is when you are already on one tab and when you click on a button on that tab you have to open new page on different tab.

– TheDeveloper
Nov 19 '18 at 16:19












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53330460%2fxamarin-forms-prism-issue-with-deeplinking-navigating-to-another-tab-and-open%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53330460%2fxamarin-forms-prism-issue-with-deeplinking-navigating-to-another-tab-and-open%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini