Reputation: 159
I'm trying to create a GoBack button in Title Bar for WINJS application with Visual Studios. I tried lot of codes, but can't get it to work.
Some of codes show's only the GoBack button, but does actually no Action, i'm beginner with WINJS/JS, and can't get a code to work.
I tried with Examples, but can't get a right code from examples, because it's not a full code for Example /* Your success and error handlers */, i don't know what i actually should put into it. Can someone help?
I Tried with this code:
(function () {
"use strict";
var currentview = Windows.UI.Core.SystemNavigationManager.getForCurrentView();
currentview.appViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.visible;
function onBackRequested(eventArgs) {
WinJS.Navigation.back(1).done( /* Your success and error handlers */);
}
})();
Thanks.
Ahm, how can i register a function as in Comments someone said? :x "Make sure you register "onBackRequested" function to currentView.backrequested event."
And Thanks for Reply's
Solved it, Thanks for Reply's
Upvotes: 0
Views: 390
Reputation: 10831
because it's not a full code for Example /* Your success and error handlers */, i don't know what i actually should put into it.
You can add success function implementation and error function implementation inside ".done()", but in your case, it is not necessary.
To make the back button functions,you can do follows:
Make sure you register "onBackRequested" function to currentView.backrequested event.
WinJS application should be a single page application, and navigation happens between PageControls or HtmlControls. Win8.1 Navigation Template offers a good example of Navigation, which can also be applied to the Windows 10 UWP. You can use it in your project.
I've made a basic navigation example that you can refer to: NavigationSample
Upvotes: 1