mvvmcross

Testing ViewModels in MVVMCorss

蹲街弑〆低调 提交于 2019-12-25 04:13:38
问题 I have just started working with MVVMCross for a cross platform app and I am having a hard time figuring out how to test my ViewModels. I tried following the testing done in TwitterSearch and ran into problems. Specifically in the MockSetup.cs I found that in the latest version of MvvmCross there no longer seems to be a IMvxViewDispatcherProvider but that is ok because I think its functionality has been rolled up into the IMvxViewDispatcher . However, when actually setting up the dipatcher

Xamarin MvvmCross MvxAppCompatDialogFragment looses BindingContext

寵の児 提交于 2019-12-25 03:59:24
问题 I've been using MvxAppCompatActivity throughout my project, but in this specific case I have to make use of a MvxAppCompatDialogFragment . Unfortunately, in this case I lose the binding context of the ViewModel somehow. MobileTestView [MvxDialogFragmentPresentation] [Register(nameof(MobileScreenTestView))] public class MobileTestView : MvxAppCompatDialogFragment<MobileTestViewModel> ... public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

Oxyplot graph takes up whole screen for display

我们两清 提交于 2019-12-25 02:44:15
问题 I just started using using oxyplot library for my project. I successfully added a donut chart in my project but the problem with this is that it takes up the whole screen to show the graph. Is tried so many way to solve this but none of them worked. Here is my axml: <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" local:layout_behavior="@string/appbar_scrolling_view_behavior" > <OxyPlot.Xamarin.Android.PlotView android:id="@

MvvmCross picturechoosen plugin and camera stuck issue

余生颓废 提交于 2019-12-25 02:07:14
问题 Hi I'm experiencing a strange problem with a MvvmCross picturechooser plugin for iOS development using Xamarin. I am developing a form where user can choose/take multiple photos and a video. My app allow users to add multiple photos either from the camera roll or to be captured directly from form. For capturing video, i use Xamarin.Mobile api. I'm using the MvvmCross picture choosen to do this. The problem occurs when 1 or 2 images / videos are taken with the camera. Once 1 or 2 images /

CoreDispatcher.HasThreadAccess “breaking change”

♀尐吖头ヾ 提交于 2019-12-25 01:58:57
问题 I am taking over an application developed with MvvmCross.vNext. While trying to update it with MvvmCross.V3, I found the following breaking change: in the constructor of the MainViewModel, we show the LoginViewModel (ShowViewModel()). It worked fine in vNext. But with V3, the LoginView doesn't show. After a long search, I found out that the following code, added in MvxStoreMainThreadDispatcher.RequestMainThreadAction : if (_uiDispatcher.HasThreadAccess) { action(); return true; } was

Integrating third party controller with MVVMCross on MonoTouch

久未见 提交于 2019-12-25 01:44:30
问题 I want to use a third party view controller that already inherits from UIViewController (https://bitbucket.org/thedillonb/monotouch.slideoutnavigation/src/f4e51488598b/MonoTouch.SlideoutNavigation?at=master), how would I integrate that with MVVMCross? I could just take the source and change it to inherit from MvxViewController, but guessing I will run into this with other libraries. Do I need to implement all the interfaces MvxViewController does? IMvxTouchView? IMvxEventSourceViewController?

MvvmCross - Soft back button does not work when using DrawerLayout

送分小仙女□ 提交于 2019-12-25 01:33:42
问题 I clone Playground Android example in MvvmCross and set DrawerLayout by default. RegisterAppStart<SplitRootViewModel>(); When navigated to SplitDetailNavView from SplitDetailView, there is no back button on navigation bar. I had to modify OnCreateView function in SplitDetailNavView public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); var view = this.BindingInflate(Resource

Plugins in ViewModel

丶灬走出姿态 提交于 2019-12-25 00:39:28
问题 I'm new on MvvmCross and I want to use my plugin in my Model/ViewMode. I use the v3. In some example I see IMvxServiceConsumer and GetService, but I guess that is the annotation for vNext but it seems to be different in the v3. So, how can I do that? Thanks 回答1: IMvxServiceConsumer<T> and GetService<T> were replaced with Mvx.Resolve<T> in v3. Further, v3 provides constructor injection of dependencies - see http://slodge.blogspot.co.uk/2013/03/v3-new-viewmodel-lifecycle.html for information

MvxRecyclerView with button in each row

拜拜、爱过 提交于 2019-12-25 00:18:40
问题 I am making an Android application with Xamarin.Android and MvvmCross. I have a MvxRecyclerView : <MvvmCross.Droid.Support.V7.RecyclerView.MvxRecyclerView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@null" local:MvxItemTemplate="@layout/auto_complete_search_item" local:MvxBind="ItemsSource SearchAutoCompleteItems; ItemClick SearchAutoCompleteItemClick" /> And my auto_complete_search_item.xml : <?xml version="1.0" encoding="utf-8"?>

MvvmCross Android binding Enabled not work with Click

两盒软妹~` 提交于 2019-12-24 22:25:23
问题 I have a TextView bound with Enabled, Clickable and Click. When the activity is loaded, Enabled & Clickable were bound to false value but the TextView cannot be disabled & still be clickable. After changed the bound value to true & then false, the TextView is disabled. I found that the issue was related to binding the Click event. Once Click is bound, the mentioned issue occurs. Without binding the Click event, it works as expected. In the following sample code, the first 2 TextViews are ok.