Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1829 from PrismLibrary/modal
Enhanced Modal Logic & Exception Handling
- Loading branch information
Showing
15 changed files
with
320 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" | ||
xmlns:prism="http://prismlibrary.com" | ||
prism:ViewModelLocator.AutowireViewModel="True" | ||
x:Class="ModuleA.Views.ViewC" | ||
Padding="{OnPlatform iOS='0,20,0,0'}" | ||
Title="View C"> | ||
<ContentPage.Padding> | ||
<OnPlatform x:TypeArguments="Thickness"> | ||
<On Platform="iOS" Value="0,20,0,0" /> | ||
</OnPlatform> | ||
</ContentPage.Padding> | ||
<StackLayout> | ||
<StackLayout> | ||
<Label Text="{Binding Title}" VerticalOptions="Center" HorizontalOptions="Center" /> | ||
<Button Command="{Binding NavigateCommand}" Text="Navigate" /> | ||
</StackLayout> | ||
<Button Command="{Binding NavigateCommand}" Text="Navigate" /> | ||
<Button Text="View B" | ||
Command="{prism:NavigateTo ViewB}" /> | ||
<Button Text="Select Tab A" | ||
Command="{prism:SelectTab ViewA}" /> | ||
<Button Text="Go Back" | ||
Command="{prism:GoBack}" /> | ||
</StackLayout> | ||
</ContentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Source/Xamarin/Prism.Forms/Navigation/NavigationException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using Xamarin.Forms; | ||
|
||
namespace Prism.Navigation | ||
{ | ||
public class NavigationException : Exception | ||
{ | ||
public const string CannotPopApplicationMainPage = "Cannot Pop Application MainPage"; | ||
public const string CannotGoBackFromRoot = "Cannot GoBack from NavigationPage Root."; | ||
public const string GoBackToRootRequiresNavigationPage = "GoBackToRootAsync can only be called when the calling Page is within a NavigationPage."; | ||
public const string RelativeNavigationRequiresNavigationPage = "Removing views using the relative '../' syntax while navigating is only supported within a NavigationPage"; | ||
public const string IConfirmNavigationReturnedFalse = "IConfirmNavigation returned false"; | ||
public const string NoPageIsRegistered = "No Page has been registered with the provided key"; | ||
public const string ErrorCreatingPage = "An error occurred while resolving the page. This is most likely the result of invalid XAML or other type initialization exception"; | ||
public const string UnknownException = "An unknown error occurred. You may need to specify whether to Use Modal Navigation or not."; | ||
|
||
public NavigationException() | ||
{ | ||
} | ||
|
||
public NavigationException(string message, Page page) : this(message, page, null) | ||
{ | ||
} | ||
|
||
public NavigationException(string message, Page page, Exception innerException) : base(message, innerException) | ||
{ | ||
Page = page; | ||
} | ||
|
||
public Page Page { get; } | ||
} | ||
} |
Oops, something went wrong.