Forum Cross Platform with Xamarin

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

KeyNotFoundException from XAML parser

Below is my XAML for a login page. I am attempting to bind to an object in another library in the same project so I can setup data binding. I have this in my constructor for the code behind

        new CSCore.VMSecurity ();

        InitializeComponent ();

When the InitializeComponet() executes it throws a keynotfoundexception. Initial I just had a ContextPage binding to the same class but it throws the same error. If I remove the reference to the VMSecuirty class it does not fail.

<?xml version="1.0" encoding="UTF-8"?>

            <ContentPage.Resources>



</ContentPage.Resources>

<ContentPage.Content>
        <StackLayout VerticalOptions="Start"
                 HorizontalOptions="FillAndExpand"
                 Orientation="Vertical"
                 Spacing="20">
        <Entry x:Name = "userName" Placeholder = "Enter your user ID" />
        <Entry x:Name = "password" IsPassword = "true" />

        <Button x:Name="loginButton" Text="Login" Clicked="OnLogin" IsEnabled="true"/>
        <Button x:Name="cancelButton" Text="Cancel" Clicked="OnCancel" IsEnabled="true"/>

    </StackLayout>
</ContentPage.Content>

Posts

  • BradMallowBradMallow USMember

    Sorry this did not show up

    <ContentPage.Resources>



    </ContentPage.Resources>

  • BradMallowBradMallow USMember

    for some reason cutting and pasting is leaving out so this is the resource dictionary entry

    <ContentPage.Resources>



    </ContentPage.Resources>

Sign In or Register to comment.