diff --git a/GalaSoft.MvvmLight/GalaSoft.MvvmLight.Platform (iOS)/Views/NavigationService.cs b/GalaSoft.MvvmLight/GalaSoft.MvvmLight.Platform (iOS)/Views/NavigationService.cs index 08a1f9f..75d33b9 100644 --- a/GalaSoft.MvvmLight/GalaSoft.MvvmLight.Platform (iOS)/Views/NavigationService.cs +++ b/GalaSoft.MvvmLight/GalaSoft.MvvmLight.Platform (iOS)/Views/NavigationService.cs @@ -15,7 +15,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Reflection; using UIKit; @@ -49,6 +48,17 @@ namespace GalaSoft.MvvmLight.Views private readonly Dictionary _pagesByKey = new Dictionary(); private UINavigationController _navigation; + /// + /// Gets the NavigationController that was passed in the method. + /// + public UINavigationController NavigationController + { + get + { + return _navigation; + } + } + /// /// The key corresponding to the currently displayed page. /// @@ -193,7 +203,7 @@ namespace GalaSoft.MvvmLight.Views throw new InvalidCastException( string.Format( "Cannot cast {0} to {1}", - controller.GetType().FullName, + controller == null ? "Unknown controller type" : controller.GetType().FullName, typeof(ControllerBase).FullName)); } } @@ -341,7 +351,7 @@ namespace GalaSoft.MvvmLight.Views c => { var p = c.GetParameters(); - return p.Count() == 1 + return p.Length == 1 && p[0].ParameterType == parameter.GetType(); });