Xamarin MVVM app events/commands not working in MacOS app

%3CLINGO-SUB%20id%3D%22lingo-sub-3104939%22%20slang%3D%22en-US%22%3EXamarin%20MVVM%20app%20events%2Fcommands%20not%20working%20in%20MacOS%20app%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3104939%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20Xamarin%20Forms%20app%20that%20uses%20MVVM%20model%20and%20ICommand%20for%20handling%20control%20actions.%26nbsp%3B%20This%20app%20currently%20works%20on%20iOS%2C%20Android%2C%20and%20WPF.%26nbsp%3B%20I've%20added%20a%20MacOS%20project%20to%20my%20solution%20and%20implemented%20the%20necessary%20Main%2C%20AppDelegate%2C%20etc.%26nbsp%3B%20While%20the%20UI%20loads%2C%20the%20button%20on%20the%20opening%20screen%20never%20fires%20any%20events.%26nbsp%3B%20I've%20added%20a%20click%20event%20as%20well%20and%20never%20receive%20that%20either.%26nbsp%3B%20When%20debugging%2C%20the%20CanExecute%20methods%20of%20my%20ICommand%20implementation%20are%20getting%20called%20and%20always%20return%20true.%26nbsp%3B%20But%20the%20Execute%20commands%20never%20get%20called%20when%20clicking%20on%20the%20button%20(nor%20do%20the%20OnClick%20event).%26nbsp%3B%20Any%20suggestions%3F%26nbsp%3B%20I'm%20assuming%20I'm%20missing%20some%20type%20of%20linkage%20needed%20to%20make%20Xamarin%20work%20in%20Mac%20but%20I%20can't%20find%20anything%20online%20as%20to%20what%20else%20is%20needed.%26nbsp%3B%20My%20code%20follows%20all%20of%20the%20examples%20I've%20found%20online.%26nbsp%3B%20I%20even%20used%20the%20code%20that%20showed%20removing%20the%20story%20board%20and%20generating%20the%20main%20window%20in%20code%20instead%20and%20it%20still%20doesn't%20work.%26nbsp%3B%20Any%20help%20would%20be%20greatly%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3104939%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EmacOS%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EXamarin.Forms%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

I have a Xamarin Forms app that uses MVVM model and ICommand for handling control actions.  This app currently works on iOS, Android, and WPF.  I've added a MacOS project to my solution and implemented the necessary Main, AppDelegate, etc.  While the UI loads, the button on the opening screen never fires any events.  I've added a click event as well and never receive that either.  When debugging, the CanExecute methods of my ICommand implementation are getting called and always return true.  But the Execute commands never get called when clicking on the button (nor do the OnClick event).  Any suggestions?  I'm assuming I'm missing some type of linkage needed to make Xamarin work in Mac but I can't find anything online as to what else is needed.  My code follows all of the examples I've found online.  I even used the code that showed removing the story board and generating the main window in code instead and it still doesn't work.  Any help would be greatly appreciated.

0 Replies