mirror of
https://github.com/bitwarden/mobile
synced 2026-01-02 00:23:15 +00:00
Improve the navigation on Windows platforms (#199)
* App: Don't default to modal pushes on Windows On Windows we generally want to avoid modal pushes as that doesn't give us a back arrow on Windows 10. Default to non-modal pushes. Signed-off-by: Alistair Francis <alistair@alistair23.me> * App: LoginPage.cs: Don't add the cancel button on Windows With Windows Phone having a HW back buton and the UWP toolbar now supporting a back button we no longer need a cancel button. Signed-off-by: Alistair Francis <alistair@alistair23.me> * src: Set a icon for UWP cancel buttons We can't always use modal pages and in that case we need to set a icon for UWP otherwise the button can't be seen on the toolbar. Signed-off-by: Alistair Francis <alistair@alistair23.me> * App: Pages: Don't add Cancel/Close button on Windows Signed-off-by: Alistair Francis <alistair@alistair23.me> * Update DismissModalToolBarItem.cs
This commit is contained in:
committed by
Kyle Spearrin
parent
baf785d9f1
commit
b4e7fd6fa8
@@ -55,13 +55,24 @@ namespace Bit.App
|
||||
|
||||
public static async Task PushForDeviceAsync(this INavigation navigation, Page page)
|
||||
{
|
||||
await navigation.PushModalAsync(new ExtendedNavigationPage(page), true);
|
||||
if (Device.RuntimePlatform != Device.Windows)
|
||||
{
|
||||
await navigation.PushModalAsync(new ExtendedNavigationPage(page), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
await navigation.PushAsync(page, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task PopForDeviceAsync(this INavigation navigation)
|
||||
{
|
||||
if(navigation.ModalStack.Count < 1)
|
||||
{
|
||||
if (navigation.NavigationStack.Count > 0 && Device.RuntimePlatform == Device.Windows)
|
||||
{
|
||||
await navigation.PopAsync();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user