ARTICLE AD BOX
A little bit of a tricky situation that I have run into trying to implement a menu bar element.
My main page contains a few elements, such as a TreeView and an info display when a TreeView element is displayed.
Most bindings in my Xaml are set relating to the TreeViewModel thustly:
<ContentPage ..Styling Elements.. x:Class="Project.MainPage" xmlns:local="clr-namespace:Project.MainPageComponents" xmlns:MainPage="clr-namespace:Project" x:DataType="local:TreeViewPageViewModel" >I've added a mainpage namespace to use to try and get the command to execute, but it seems to not see the command:
ContentPage.MenuBarItems > <MenuBarItem Text="File" > <MenuFlyoutItem Text="Files" x:DataType="MainPage:MainPage" Command="{Binding OpenWindow}" />In the MainPage, I have been trying to get the following working:
[RelayCommand] private void OpenWindow() { ..creating and opening a window logic.. }I never get into the OpenWindow (as the breakpoint does not activate) whenever I click the drop-down File element, and I do not see any response either. The only thing I have to go on is that "OpenWindow" is a "Member that is not found in data context of MainPage"
I am kind of thinking that the command should not be part of a Binding declaration, but everything I come across uses it like that, and then calls it through a RelayCommand without any property declaration
