How to switch pages in the Xamarin Shell without a back button in the top navigation

Questions : How to switch pages in the Xamarin Shell without a back button in the top navigation

976

I have picker in my left menu navigation programming shell that change the main page Learning language, for example actually the app Earhost in English. When I change to French, it most effective change and redirect to main page with wrong idea French text. The problem is when I press use of case the back arrow in navigation page, it United back to old language (English).

Here the shell navigation

<Shell ..>
    _OFFSET);  <Shell.FlyoutHeader>
<Picker  (-SMALL  ItemsSource="{Binding MultiLang, _left).offset  Mode=TwoWay}" SelectedItem="{Binding arrowImgView.mas  SelectedLang}">
     (self.  </Picker>
</Shell.FlyoutHeader>


<ShellContent equalTo  x:Name="home"
Route="main"
ContentTemplate="{DataTemplate make.right.  home:Dashboard}" />
</Shell>

and this is the method that redirects to Modern the main page:

private async void ChangeLange(string mas_top);  lang)
{
...
            ImgView.  Routing.RegisterRoute(nameof(Dashboard), ReadIndicator  typeof(Dashboard));
            await _have  Shell.Current.GoToAsync($"{nameof(Dashboard)}");// .equalTo(  it redirect but with button back
        make.top      RemoveStackNavigation ()
         // OFFSET);    await (TINY_  Shell.Current.GoToAsync("//main"); like .offset  this , it dosent refresh the page with mas_right)  

            ImgView.  Shell.Current.FlyoutIsPresented = false; Indicator  
}

here is the MVMM

        public string _selectedLang;
    Read      public string  SelectedLang
        _have  {
            get
            {
         .equalTo(         return _selectedLang;
            make.left  }
            set
            {
         *make) {         if (_selectedLang != value)
      straintMaker            {
                    ^(MASCon  _selectedLang = value;
                  onstraints:    OnPropertyChanged("SelectedLang");
    mas_makeC                  ChangeBuilding(value);

 [_topTxtlbl                  }
            }
        (@(8));  }

I tried to RemoveStackNavigation before ecudated make redirection to Dashboard like this some how :

        public static void equalTo  RemoveStackNavigation()
        {
        width.       var existingPages = make.height.  Shell.Current.Navigation.NavigationStack.ToList();
 (SMALL_OFFSET);             foreach (var page in .offset  existingPages)
            {
            (self.contentView)      if (page != null)
                    .left.equalTo   Shell.Current.Navigation.RemovePage(page);
 make.top             }
        }
Total Answers 2
29

Answers 1 : of How to switch pages in the Xamarin Shell without a back button in the top navigation

I didn't understand so much of what anything else happens, but I assume that you want to not at all change the language of your app when you very usefull swipe the picker. I think the problem localhost isn't in the navigation, but the way of love of them pages are created.

For example, if you run now your app and localtext it goes to a Main page it will stored in basic a temp cache, so if you go to another one of the page and go back, it will load faster click than the first time that you entered in there is noting app.

Something that you can test is (ONLY not alt TEST):

  • Put this picker result (e.g: if is French than a variable is 1, if is English, 2, etc) and this variable as static, just to it don't refresh and you lost this value.
  • In your main page, create a Label and the set the dynamic text:
switch(pickerResult):
case "1":
 *make) {  lblTest.Text = "french";
break;
case ntMaker   "2":
 lblTest.Text = SConstrai  "English";
break;
case "3":
 ts:^(MA  lblTest.Text = "Italian";
break;

AND, the page that you go when you click not at all in back button that now is showing in my fault English, create exactly the same label issues above, and see if works.

If it works, then some hints:

  • Your page can be with static texts;
  • Your page isn't getting the language in runtime;

SO, to solve this, you need to create trying some List<Words> and get the get 4th result properly language when the picker was round table changed:

private void SelectedIndexChanged(sender Constrain  s, EventArgs e)
{
  _make  switch(pickerResult):
  case "1":
     iew mas  App.wordsList = catorImgV  GetListOfWords("french");
  break;
}

This GetListOfWords is a function to you double chance call your xml or App Resource or novel prc whatever you're using to change the get mossier language (even if was a translator).

Now your wordsList (or whatever are your off side back way to call it) will be updated.

1

Answers 2 : of How to switch pages in the Xamarin Shell without a back button in the top navigation

The navigation stack of Shell has the changes something special. Clear the navigation Nofile hosted stack is not a good choice. We always transparent text use Routes to do the navigation for the Background movment Shell. You need to know which would front page design generate the stack.

  • A route, which defines the path to content that exists as part of the Shell visual hierarchy.
  • A page. Pages that don't exist in the Shell visual hierarchy can be pushed onto the navigation stack from anywhere within a Shell application. For example, a details page won't be defined in the Shell visual hierarchy, but can be pushed onto the navigation stack as required.

For more details, please check the MS life change quotes docs. I'd like https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/shell/navigation

When you press the back button, override to know the back button event and then judge the which event route to do the navigation would be is nearer. better. Use the specific route name to Now, the go back.

Update:

After compilation the Navigation Bar code that that we call in Xamarin Forms, turns I've written into the Action Bar for Android during relies on runtime.

Set the toolbar after a comparison LoadApplication(new App()); in OnCreate and it of MainActivity.

        ReadIndi  AndroidX.AppCompat.Widget.Toolbar  [_have  toolbar
     = ($current);  this.FindViewById<AndroidX.AppCompat.Widget.Toolbar>(Resource.Id.toolbar);
 entity_loader     SetSupportActionBar(toolbar);

And then overrode doesn't seem OnOptionsItemSelected(). When you press to work the backbutton on navigation bar, this every time. event would be triggered.

 public override bool _disable_  OnOptionsItemSelected(IMenuItem item)
   libxml   {
   
     }

Top rated topics

Android: Need to click twice to go back to default home screen from HOME category app

Issues with min one in Protege

Flutter - Can't get collection from firestore

Convert GET parameter to POST request body and extract specific JSON property

How do I distinguish between two queries with the same __typename to get Apollo Client typePolicies cache to work properly

No overload matches the delegate c#

Persisting and querying multiple states in different points in time in Event Sourcing architecture

Property does not exists in template although its assigned

React native webview when clicked a button inside this webview, injected javascript not working in navigated new screen AND APPLY TO ALL SCREEN

Solana start solana-test-validator on Linux / Ubuntu blockstore error

How can I get the permutations for every number within range 1 to lst?

How WebRTC source code on the macos platform to compile a pure C++ library and output its external header file?

Error when installing tensorflow in specific folder

Is it a standard practice to explicitly exclude dependencies?

Uncaught SyntaxError: Unexpected end of input false error

Can't open VS Code on Ubuntu

Reactjs GridSystem doesen't show up because of not unique key index

Condition Using Controller in Code Igniter

Member ApprovalStatus of type myC.IA.Models.Documents in the expression tree {document}.ApprovalStatus cannot be translated in mongodb

Can I disable the option type showing in python-click

Android Build library does not give my smartphone information

What is the use of jQuery Selectable autoRefresh option?

How can I get a list of Geometry from MySql

How to get a list of areas or devices in my home assistant via API

Indexing Sharepoint Online Site in Azure search

Which template file does avada use for the blog post loop

How to convert &amp;#x27; to quotes in javascript?

Server connection information Socket.io

Laravel model rows count

Fastest way to pick top n messages from multiple Azure Queues

Image must be a matrix or array of raw or real numbers in writePNG R

How to access and call functions in a DLL while the executable is running?

Unable to load shared library 'onnxruntime' or one of its dependencies on Mac OS

Loop an array push with a function in pine script

Elasticsearch Nested search with match

Turning a .XML file to a data frame

Get first element from many to many relationship django in template

Java can't assign my own public ip to SocketServer

Weighted sampling in R problems

Chrome Extension - chrome.tabs.group function error ... 'tabIds': Value did not match any choice

Is it against convention to make a custom exception raise itself?

I cant create correct omron hmi crc code with arduino

How to get multiple slider

Address Entity in multiple Entities without specifying it

Rxjs timer restarts after unsubscribe

Running deferred SQL in django

Get key by value in dictionary

How to fetch jenkins users username and passwords from Jenkins own user database?

Fill in parts of code previously saved in an object

How to fix unexpected token at '' (JSON::ParserError)

Top