Base solution for your next web application
Open Closed

ViewModel binding context within DataTemplate #10213


User avatar
0
Astech created

Hi,

When I include the ContentPage.BindingContext on my page, the app crashes when trying to load the page.

`


    

`
I'm trying to use OpenContextMenu command which is a command inside my viewmodel.

`



    

The viewmodel command:
public TeamsViewModel(ITeamsAppService teamsAppService)
{
_teamsAppService = teamsAppService;

        OpenContextMenuCommand = new Command(item => item.IsPopupOpen = !item.IsPopupOpen);
        Teams = new ObservableRangeCollection();
    }

    public Command OpenContextMenuCommand { get; }

`

  • What is your product type (Angular or MVC)? MVC

  • What is product framework type (.net framework or .net core)? .NET Core


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Astech

    Do you have any error message which you can also share with us ?

    Thanks,