Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Unable to cast object of type 'Xamarin.Forms.ContentPage' to type 'Xamarin.Forms.View'

$
0
0

Ok, I must be missing something. I am running into an odd issue below when I add a BindingContext and Set the IsBusy property at the Tabbed Page Level in one of my Xaml Files

`<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MyApp;assembly=MyApp"
BindngContext="{StaticResource model}"
x:Class="MyApp.MainView"
IsBusy="{Binding IsDataLoading}"

`

Here is the full call stack from RootFrame_NavigationFailed in the WinPhone App. Any suggestions on how to troubleshoot?

"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Unable to cast object of type 'Xamarin.Forms.ContentPage' to type 'Xamarin.Forms.View'.\r\n at Xamarin.Forms.VisualElement.<.cctor>b__2(BindableObject bindable, Boolean oldvalue, Boolean newvalue)\r\n at Xamarin.Forms.BindableProperty.<>c__DisplayClass42.b__1(BindableObject bindable, Object oldValue, Object newValue)\r\n at Xamarin.Forms.BindableObject.<>c__DisplayClass1.b__0()\r\n at Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, Object value, Boolean clearBindings, Boolean raiseOnEqual, Boolean checkaccess)\r\n at Xamarin.Forms.BindingExpression.ApplyCore(Object sourceObject, BindableObject target, BindableProperty property, Boolean fromTarget)\r\n at Xamarin.Forms.BindingExpression.Apply(Object sourceObject, BindableObject target, BindableProperty property)\r\n at Xamarin.Forms.Binding.Apply(Object newContext, Bin
dableObject bindObj, BindableProperty targetProperty)\r\n at Xamarin.Forms.BindableObject.ApplyBindings(Object oldContext)\r\n at Xamarin.Forms.BindableObject.SetInheritedBindingContext(BindableObject bindable, Object value)\r\n at Xamarin.Forms.Element.OnBindingContextChanged()\r\n at Xamarin.Forms.BindableObject.BindingContextPropertyBindingPropertyChanged(BindableObject bindable, Object oldvalue, Object newvalue)\r\n at Xamarin.Forms.BindableProperty.<>c__DisplayClass4

2.<Create>b__1(BindableObject bindable, Object oldValue, Object newValue)\r\n   at Xamarin.Forms.BindableObject.<>c__DisplayClass1.<SetValueCore>b__0()\r\n   at Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, Object value, Boolean clearBindings, Boolean raiseOnEqual, Boolean checkaccess)\r\n   at Xamarin.Forms.BindableObject.SetValue(BindableProperty property, Object value, Boolean checkaccess)\r\n   at Xamarin.Forms.BindableObject.SetValue(BindableProperty property, Object value)\r\n   at Xamarin.Forms.Xaml.Bas
eValueNode.SetPropertyValue(Object xamlelement, XmlName propertyName, Object value)\r\n   at Xamarin.Forms.Xaml.MarkupNode.ApplyTo(Object source, XmlName propertyName, INameScope namescope)\r\n   at Xamarin.Forms.Xaml.INodeExtension.ApplyProperties(IElementNode node, Object source, INameScope namescope)\r\n   at Xamarin.Forms.Xaml.RootNode.ApplyProperties(INameScope namescope)\r\n   at Xamarin.Forms.Xaml.XamlLoader.Load(VisualElement view, String xaml)\r\n   at Xamarin.Forms.Xaml.XamlLoader.Load(VisualElement view, Type callingType)\r\n   at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TView](TView view, Type callingType)\r\n   at MyApp.MainView.InitializeComponent()\r\n   at MyApp.MainView..ctor()\r\n   at MyApp.App.GetMainPage()\r\n   at MyApp.WinPhone.MainPage..ctor()\r\n   --- End of inner exception stack trace ---\r\n   at System.Windows.Navigation.PageResourceContentLoader.EndLoad(IAsyncResult asyncResult)\r\n   at System.Windows.Navigation.NavigationService.ContentL
oader_BeginLoad_Callback(IAsyncResult result)"

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>