-
Notifications
You must be signed in to change notification settings - Fork 2
Commands in the Xamarin forms demos will not fire when added to the details page #58
Comments
Please provide a description of how exactly you add the command binding |
C#
XAML:
ViewModel command:
|
I've formatted your post. Also there is a MvxAsyncCommand for async operations which you might want to use instead. Will take a look if I can reproduce your issue. |
MasterDetailPage-MvvmCross-master 4.zip Attached example with code aboved added to the todolistpage & todolistviewmodel. really appreciate if you can help resolve as this is a blocker for us moving forward. |
Your sample uses unsupported and outdated nuget packages. Please update them to non-HotTuna. Anyways. When navigating to the TodoListPage, and checking the BindingContext in OnAppearing, its BindingContext is MainViewModel and not TodoListViewModel. This is your problem. Why this is the case, I have no idea. At least you now know what is going on... |
Sample is directly from the Xamarin mvvmcross forms git repository. Hence I think the issue is in the mvvmcross forms demo the team provided with mvvmcross forms. |
Do you know who the mvvmcross forms owners is, maybe they can ahead some light on the issue. Looks like all the detail view models are bound to the mainviewmodel. Alternatively, how to force binding it to correct one after the fact. From what I recall there is a way to bind a page to multiple viewmodels |
What is the link for that sample? I dunno who submitted it, a |
Do you by any chance have another example where masterdetail is used with Xamarin forms version of mvvmcross . That will solve it for us |
found the xamarin forms example source: |
Apologies : here is the MVVM Cross forms one :https://github.com/robinmj/MasterDetailPage-MvvmCross |
Which is not an official source. You could try ask the author of the sample. I don't think we have a sample showing MasterDetailPage. A PR showing this would be appreciated. |
Hi! I'm working on a way to use a MasterDetailPage with MvxForms using a custom Presenter. I think that I could provide a PR with implementation and an example. Do you agree with this? |
PRs are welcome. |
OK, The PR is live now #60 Please check it to see if everything is fine. |
When can PR #60 be merged and pushed to nuget store. |
To help us fix your issue, please provide the information in the below template.
Steps to reproduce
Expected behavior
Commands should fire like they do with the rest of mvvmcross
Actual behavior
and does not fire
Configuration
Version: 4.x
Platform: iOS/Android/Windows UWP
All platforms . iOS, android and uwp
The text was updated successfully, but these errors were encountered: