Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Binding Commands to Resource data

$
0
0

Hi all!

I have a ContentPage array of my models and ICommand properties in ContentPageViewModel of this page:

<ContentPage.Resources>
        <ResourceDictionary>

            <!-- Menu Data -->
            <x:Array x:Key="NavigationItems" Type="{x:Type master:MenuItemViewModel}">
                <master:MenuItemViewModel Text="{extensions:Translate AllJobsPageTitle}"
                                          ImageFileName="ic_assignment.png"
                                          Command="{Binding GoToAllJobsCommand}"/>
                <master:MenuItemViewModel Text="{extensions:Translate MyJobsPageTitle}"
                                          ImageFileName="ic_assignment.png"/>
                <master:MenuItemViewModel Text="{extensions:Translate MyTasksPageTitle}"
                                          ImageFileName="ic_assignment.png"/>
                <master:MenuItemViewModel Text="{extensions:Translate LogoutButton}"
                                          ImageFileName="ic_assignment.png"/>
            </x:Array>
        </ResourceDictionary>
    </ContentPage.Resources>

In MenuItemViewModel i also create a Command property:

public ICommand Command
        {
            get;
            set;
        }

But when i trying to create a first item i get an error: Error No property, bindable property, or event found for 'Command', or mismatching type between value and property

In this case i can't use the Binding markup extension. How can i do this? Any ideas?~~~~


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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