mvvmcross

Change default timeout

喜你入骨 提交于 2019-12-12 12:26:52
问题 I have the following implementation. And the default timeout is 100 seconds. I wonder how can I able to change the default timeout? HttpService.cs public class HttpService : IHttpService { private static async Task GoRequestAsync<T>(string url, Dictionary<string, object> parameters, HttpMethod method, Action<T> successAction, Action<Exception> errorAction = null, string body = "") where T : class { using (var httpClient = new HttpClient(new HttpClientHandler())) { } } } 回答1: The default

async Init and Property Changed in MvvmCross

為{幸葍}努か 提交于 2019-12-12 12:04:45
问题 I have some async calls from Init in view model. The problem is that sometimes async call returns before OnCreate, and the property in UI is not updated. Is there proper async/await model for this case, when we have to init async data? pseudo code: // ViewModel public async Task Init(string id) { Url = await LoadUrlAsync(id); } // View protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.ui_xml); ViewModel.PropertyChanged += ViewModel

How can I detect the platform at runtime using MvvMCross?

百般思念 提交于 2019-12-12 10:58:31
问题 I want the user to be able to send feedback about my app to an address. Using the email plugin, this is all good, but in the body of the email, I want to pre-populate some information about the app they're running. Ideally, I'd like the device, the OS, the screen res, the orientation etc, but for now I'd just settle for the OS 回答1: It feels quite strange, but I can't remember anyone ever asking for this as a feature and I don't think anyone's made a plugin for it either. Given your future

Use Mvvmcross Binding with MonoTouch.Dialog (Lists and Commands)

久未见 提交于 2019-12-12 07:22:28
问题 1. Binding Lists I wonder how I could bind a ObservableCollection to a Radiogroup: new Section(){ new RootElement("Mandanten", new RadioGroup("mandanten", 2)) { new Section(){ new RadioElement("Kupus", "mandanten"), new RadioElement("Kajmak", "mandanten") } } } as you see here I'm creating 2 Items/Elements manually but I miss something like an "ItemsSource". If its not possible, what recommendation would you give me? To use witch Control (to bind Lists)? 2. CommandBinding As I see theres no

Fragments in MVVMCross 4.1.4 will not be displayed in the Activity (Android)

感情迁移 提交于 2019-12-12 06:37:06
问题 I try to add a fragment to an activity and have already looked at the example from Martijn00. My problem is, that the activity will be displayed but the fragment will not and in debugging mode, the debugger is not running into the fragment's method OnCreateView. So the attribute of the fragment will be used, but not the fragment. I see only my activity with the green background. I am sure I do something wrong, but after 6 hours I do give up and ask you guys for help :) Fragment: namespace

SaveState in MvvmCross is not being called in an iOS application

≯℡__Kan透↙ 提交于 2019-12-12 05:49:50
问题 I am using MvvmCross v3.5 to build an iOS application. Whenever the application goes into the background I am expecteing SaveState to be called in the view model. However it never gets called. I have tried this both on the simulator and a device. Am I missing something. This works in the Android version of the app, so I think I have set it up correctly. Has anyone else got this issue? Any help would be appreciated. 回答1: I think in Xamarin you need to implement UIApplicationDelegate

MvvmCross watch property from View

家住魔仙堡 提交于 2019-12-12 04:38:26
问题 I want my android View to trigger a method to create a Toast message whenever a certain property changes in the ViewModel. All the examples I'm finding are binding within the XML. This seems so much simpler yet I can't find any examples. 回答1: You can do this by creating a weak subscription to the viewmodel inside the view and showing the toast when the property changes as follows:- public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Android.OS.Bundle

ClassNotFoundException Mvx.MvxListView

不羁岁月 提交于 2019-12-12 04:23:38
问题 I'm trying use MvxListView with MvxAppCompatActivity , but I always get: InflateException: Error inflating class Mvx.MvxListView ClassNotFoundException: Didn't find class "Mvx.MvxListView Here is my axml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res/com.viniciusmaia.missaocarona" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <include layout="@layout/Toolbar" />

CustomFragment in MVVMCross

人走茶凉 提交于 2019-12-12 04:10:10
问题 I have used the following template in my Android application which has navigation drawer has a list of options such as Settings . https://github.com/MvvmCross/MvvmCross-Samples/tree/master/XPlatformMenus Source code could be downloaded from the following url https://github.com/MvvmCross/MvvmCross-Samples I wonder how could I able to make Settings page as a Dialog or CustomFragment which will look like similar to following image. 回答1: One approach that you could make use of is to create a

Xamarin mvmcross tab navigation between view models

南笙酒味 提交于 2019-12-12 03:35:49
问题 I have two screens which are linked to two tab buttons Name Duration I would like tab to move to second button when I click Next button. In my view model this is my command for Next Button Here is my code sample public IMvxCommand NextCommand { get { return new MvxCommand(() => ShowViewModel<RecyclerViewModel>()); } } Rather than tab moving to next tab second view is opening in full screen. Screens attached First screen Second screen Screen I am seeing 回答1: I this situation i would not use