mvvmcross

How to set visibility for ProgressBar in android MvvmCross Xamarin

心已入冬 提交于 2019-12-31 06:12:11
问题 I am trying to set visibility for ProgressBar as GONE . In XML <?xml version="1.0" encoding="utf-8"?> <ProgressBar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content" android:layout_height="wrap_content" local:MvxBind="Visibility Visibility(ProgressVisibility)" android:background="@drawable/sel_custom_progress" /> In ViewModel private bool _progressVisibility; public bool ProgressVisibility { get

How to bind imageSource to ImageView in MvvmCross

老子叫甜甜 提交于 2019-12-31 03:02:51
问题 I'm having trouble to bind a source with converter to an imageview in my Touch project. I found here and here how to make it in Android public class TypeToSourceConverter : MvxValueConverter<int, string> { protected override string Convert (int value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { var assetName = ((AppConstants.Type)value).ToString ().ToLower (); return "Images/" + assetName + ".png"; } } But I'm having trouble in how to use this converter in

MvxRecyclerView Fluent API binding

微笑、不失礼 提交于 2019-12-31 02:45:09
问题 I am unable to bind ItemClick from MvxRecyclerView (or its Adapter) to a command on my ViewModel using Fluent API. It works if I put both ItemsSource and ItemClick in the XML so I am not interested in such solution. I used this post as an excellent guideline (How to use the MvvmCross fluent API to bind a RecyclerView item's TextView to a property of its ViewModel on Android?) and all of that works except that I am unable to bind ItemClick on MvxRecyclerView (or the adapter) to a MainViewModel

MvvmCross DataService in an Android Broadcast listener

半世苍凉 提交于 2019-12-31 01:54:09
问题 I am currently venturing into the MvvmCross realm and making some good headway, but ran into something that I have been unable to figure out on my own. I currently have an android service that is going to be running all the time. That service is going to be started either on a system boot or when the application first fires up. That service/broadcast receiver will need access to the DataService that is created in a PCL project with MvvmCross. I have not been able to figure out how to get the

Fluent Bindings and UIButton titles

拥有回忆 提交于 2019-12-30 17:19:08
问题 Since my user interfaces generally need to have localized strings, my view models provide all the strings which the views consume. This includes things like the titles on buttons. on the iOS side, button titles are set via the SetTitle method. In order to get a view model string => button title mapping to work, MvvmCross does some magic binding translation to get this to work nicely. say I have a UIButton named Foo in my view and I want to map its title to a property ButtonLabel in my View

Tabs in the actionbar with mvvmcross

时光怂恿深爱的人放手 提交于 2019-12-30 12:40:47
问题 Using mvvmcross it's posible to put tabs in the action bar as the Android documentation suggest?, I've seen the Fragment sample and notice that the tabs are inside a TabHost, the same approach would be perfect but using the action bar instead. Thanks in advance 回答1: Great example how to do it from cheesbaron: http://blog.ostebaronen.dk/2013/07/fragments-and-viewpager-with-mvx.html 来源: https://stackoverflow.com/questions/20271805/tabs-in-the-actionbar-with-mvvmcross

Unable to add Xamarin.Android and Xamarin.iOS to PCL

≯℡__Kan透↙ 提交于 2019-12-30 10:57:06
问题 I'm trying to workout a sample project using MvvmCross, but I'm stuck with the first step of adding the frameworks in VS2012. When I try to add Xamarin.Android and Xamarin.iOS framework in a PCL project, it is showing an error There is no available functionality that is portable between the frameworks you have selected I tried following the steps in this answer, but it didn't worked. Can someone shed some light on this issue. Thanks. 回答1: Recent (mainly good) changes from Microsoft mean that

mvvmcross binding on switch fails on release

一个人想着一个人 提交于 2019-12-30 08:28:29
问题 I have a weird bug in my MVVMCross app. Considering the following scenario: <Switch android:layout_width="wrap_content" android:layout_height="wrap_content" android:focusable="false" android:clickable="false" android:layout_alignParentRight="true" android:id="@+id/activatedSwitch" local:MvxBind="Checked IsActive" /> Compile version: level 14 Minimum version: level 14 Target version: level 14 Linking: Sdk Assemblies Only Android Phone version is 4.1.2. When I run the app in Debug mode, all is

MvvmCross - Calling Web Service from View Model

≯℡__Kan透↙ 提交于 2019-12-30 03:36:04
问题 I'm new to MvvmCross and Android development. I have a need to call to POST data to a JSON web service in my view model. I then need to display the result of the web service back in my UI. The gist of my view model looks like the following: public class MyViewModel : MvxViewModel { public override void Start() { base.Start(); } public event EventHandler<EventArgs> Service_Finished; public void CallService() { string url = GetServiceUrl(); WebRequest serviceRequest = HttpWebRequest.Create(url)

MvvmCross Using a modal ViewController from a Tab

北战南征 提交于 2019-12-29 08:43:09
问题 I've searched on SO & elsewhere for MvvmCross & Modal, but the one existing answer isn't helping us. We're developing a cross-platform app using MonoTouch & MvvmCross, which seems to be pretty powerful combination. However, we're having a few issues with the navigation, which we're gradually cracking! The current problem is - The app runs with a TabBarController, and each tab has navigation to further levels - this works fine. The client however wants the "Start" button on one of the tabs to