c# - Page-based action for back button -


My question is how to define your action for a given page, ie, first click on the button Close Popup and Page Navigate from the other?

Since the WP8.1 navigation helper is quite useful, it only gives a general action to click on the back key (exit page).

I can not overwrite the NavigationHeller because it does not give any setters for it. The command and handler for private button handles are private, so I can not unpin it on the page, change the navigation Helper Looks ugly because I W8.1 & amp; I am developing the universal app for WP8.1 and I have many pages that require a custom handler for the back button.

- Edit -

Orders are allowed to overwrite, however, I will use the original command on every page. Solve a new order on every page?

I think you can be a member of Windows Phone. UI.Input.Hardware Buttons Press before the navigationHelper (as I loaded it in the page. Loaded Event) In fact for this purpose (as you will add event handlers later), you will need a special encoding method that will allow your event holders Will invite:

App.xaml.cs Create a method and a list of handhelds: // Private List & amp; Lt; Event handler & lt; BackPressedEventArgs & gt; & Gt; ListOfHandlers = New list & amp; Lt; Event handler & lt; BackPressedEventArgs & gt; & Gt; (); Private Waste Invokingmath (Object Sender, Backuppress Eventory E) {For (Int i = 0; I & lt; List Ofhands.Count; I ++) Listoff Handlers [I] (Sender, E); } Public events event handler & lt; Backpress Events & gt; MyBackKeyEvent {add {listOfHandlers.Add (value); } Remove {listOfHandlers.Remove (value); }} // See that as it is a collection, you can create a variety of things with it / provide a way to do that, for example, that your new event will bring it to the top // This is the first public Zero AddToTop (EventHandler & Lt; BackPressedEventArgs & gt; eventToAdd) {listOfHandlers.Insert (0, EventtoAdd); } // In the App Builder: - Subscribe it as the first event handler! HardwareButton Backpress + = encoding method; // Subscription: (App as App.Current) .myBackKeyEvent + = MyClosingPopupHandler; // or (as AP.P.) adaptope (miclossingpophandler); // It should be removed for the first time / you will also have to change the hardware side of the hardware in the CDS behavior. Press the BACKPRESS so that it will not be e-hydelead, while E. Helmed == True Private Zero Hardware Boots Backpress (Object Sender, Windows.phone.UI Input. Backpack Event E. E.) {If (E. Handle) {// Rest of code}}

This In case the backpress is pressing Navigation before the helper's event holder and if you have e. Handeled = true; Then you should stay on the same page.

Also keep in mind that instead of modifying App.xaml.cs, you can increase your page class or navigation helper in this way, depending on your needs.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -