In a WP7 app, in OnNavigatedTo, how can I distinguish that the Back key was pressed on another Page of the application, or on Start Screen/in another application to navigate back to my application?
The NavigationMode.Back does not give me a help, it is true for both event.
Please a have a look on e.IsNavigationInitiator property. If it is true, navigation is within the application. If its false, navigation is from background.
More detail : http://msdn.microsoft.com/en-us/library/system.windows.navigation.navigationeventargs.isnavigationinitiator(v=vs.110).aspx
Related
So I have this Laravel 9 project. In this view below you can see the navigation bar:
The menu above for the active link (Overview) styling (Tailwind) is active via the check below in the view for the component looking at the request information:
#if(request()->is('dashboard/*/overview'))
This works great as the url currently is
localhost/dashboard/{ID}/overview
When clicking the bottom nav link for the Dividends this fires a livewire event for this account as they don't have permissions to access the page. No navigation away from the page Overview is performed. This event is used to setup a popup when the user doesn't have access to a feature. (I have these in a few places)
The issue is that when one of these fires it sets the 'is' check value in the request to
/livewire/message/{COMPONENT_NAME}
This seems to be the expected behaviour of the livewire events. I attempted a similar check using the code below but the same result occurred as the data is still tied to the request.
#if(request()->pathInfo == "dashboard/7/overview")
If anyone knows of another way or a better way I could have the intended functionality so that the button keeps it's 'active' properties after a livewire event has ran, I'd appreciate it :)
We're starting on a Xamarin.Forms app, and there are going to be quite a few pages and the navigation between pages will be handled completely by the app - specifically there is no back button, which shouldn't be a problem since we are only planning on releasing for iOS.
The first page the user encounters is the Login page, once logged in they go to the Home page. To perform this transition I just call
LoginPage.Navigation.PushModalAsync(HomePage)
and that's fine.
Now if, on the Home page, they press the Logout button, I could call PopModalAsync(), the problem is that the Logout button exists on all the pages, so the user could have followed a path like this:
Login -> Home -> Create -> Format -> Print -> Logout
and I need to immediately jump to the Login screen.
So on the Home page, if the user presses the Logout button, I tried calling
ApplicationHomePage.Navigation.PushModalAsync(LoginPage);
but got an exception:
System.InvalidOperationException: Page must not already have a parent.
So just for fun I thought I'd try the easy solution:
LoginPage.Parent = null;
ApplicationHomePage.Navigation.PushModalAsync(LoginPage);
I'm never going to have a back button, and the iPad doesn't have one, so the contents of the navigation stacks aren't really important (right?)
Is this method of navigating "legal"? Is it going to cause me some problem I'm not seeing right now?
I think you can take a look to this
You should don't add your login page to a NavigationStack. Change MainPage property is a good solution...
I am hoping someone can point me in the right direction. I want to create a wp7 panorama type applicaton.
The applicaton requires the user to be logged in for the user to be able to work with a group of panorma items.
So I start creating a Panorama application deleting the MainPage.xaml file and create a new panorama page in my Views folder called MainDetailsView. I have updated the VMAppManifest file to point to the new view.
What is the best way to create a login view that fits into the panorama styled application. Do Ijust create all of the panormaitems I want within MainDetailsView, binding the visibility of each of the PanoramaItems to a converter. If the user is logged in then set the visibilty to true else set it to false?
How then does this fit using the mvvm pattern?
Your login UI could be embedded within a Popup that you show on top of the panorama when required.
Also, Peter Torr has a couple of posts on how to exit a Windows Phone application and how to redirect an initial navigation that touch on that scenario.
I'm trying to develop an application and am stuck at this specific part. I was previously taking a different approach through a web form displayed in UIWebView, but was having issues getting it to open how I wanted. I changed the UI and would now like to take this approach:
Background
User needs to be able to get directions to a specific shop location. The UI contains an instance of UIText Field and a round rect button. The User should be able to click the button and the default Maps application will pop up for the user.
How I imagine this being coded:
1) User enters address in textField
- textField stores address as variable (%var%)
2) User presses Go button
- Button adds variable (%var%) from textField to URL string (see below)
- Button submits full URL to be opened in Safari
3) Safari opens request in Maps application
Image Example of UI: http://i55.tinypic.com/vnjc41.jpg
http://maps.google.com/?saddr=%var%&daddr=123+Road+St%2C+Town%2C+CA+90210&hl=en
Found a better way to do this using a button to open the maps application:
-(IBAction)hbgdirButton:(id)sender{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://maps.google.com/maps?q=Harrisburg+PA&hl=en"]];
}
The data is displayed in gridview with paging on an AJAX enabled webpage. The gridView contains Item templates containing a link button. On itemCommand event, page redirects to display data in new page. When the Back button on browser is pressed, the previous state of the page doesn't load.
Perhaps set a cookie and use it to get the right page when initializing the gridview. Or modify the hash at the end of the URL (eg, add "#page2" to the location bar and read it back on init).
Look at this js stuff from google
Use Google Web Toolkit, it allows the state to be bookmarked and isn't affected by back/forward button.
Otherwise your options are:
Telling the user to not press the back button.
Putting the state in the url, e.g mypage.asp#page_123 and using that to determine the state in your javascript at page load.