mvvmcross

How to do CreateBindingSet() on Windows Phone?

杀马特。学长 韩版系。学妹 提交于 2019-12-10 10:03:49
问题 In the N+1 video #34 (Progress), there was an example of using CreateBindingSet() for the Android version, which is not typical. But the narrator also mentioned briefly that the same can be done on the Windows platform. As much as I tried, however, I am unable to get a View's property to be bound to its ModelView on the Windows Phone. I always get a NullReferenceException . The closest I came was the code below, including suggestions from ReSharper. Here's my FirstView.xaml.cs: using Cirrious

MvvmCross Android Dialog bind programmatically

回眸只為那壹抹淺笑 提交于 2019-12-10 09:43:46
问题 I want to use the Android.Dialog ( Cross.UI ) in my MvvmCross project. My first approach was to use AutoViews. As this feature is still fairly young, the alternative was to implement the dialog in touch and Droid platforms. For now i'm just doing this for Droid and I need to programmatically bind the properties of the ViewModel to the elements of the Dialog. My View and ViewModel code is the following: View public class DialogConfigurationView : MvxBindingDialogActivityView

Binding to Path ImageView in MvvmCross for MonoDroid/Android

本秂侑毒 提交于 2019-12-10 09:37:57
问题 In my case path "MyZooSnap.Core;component/Resources/Images/i.jpg" . How to convert path for Android ImageView ? In order to use it in the following binding: {'AssetImagePath':{'Path':'ImagePath'}} More here similar questions Thanks 回答1: Quick answer: if your Android image file is stored in assets/images/i1.png then make sure it is marked as an AndroidAsset then your path needs to be images/i1.png Longer answer: Ideally your ViewModel should be platform independent and not know about View

Check whether Internet is on or off in Xamarin Android

霸气de小男生 提交于 2019-12-10 03:58:11
问题 I am working on Xamarin Android Application.Before proceed to my next fragment I want to check Internet Connection and inform user about it ? How can i implement that ?And how to refresh whole fragment after user switch-on the internet? Any advice or suggestion will be appreciated ! 回答1: Try this : NetworkStatus internetStatus = Reachability.InternetConnectionStatus(); if(!Reachability.IsHostReachable("http://google.com")) { // Put alternative content/message here } else { // Put Internet

How do you bind a ViewModel to the Windows 8 Settings pane in MvvmCross?

醉酒当歌 提交于 2019-12-09 22:32:01
问题 I've been looking at MvvmCross for cross platform mobile development. Since navigation of views is done by calling ShowViewModel<>(), how would you create the settings pane (which is a user control) in Windows 8 using MvvmCross? 回答1: MvvmCross provides a general ShowViewModel<T> navigation mechanism which uses a Presenter to display and set the DataContext on View s. Views that are shown this way typically cover the 'whole screen' and benefit from automatically constructed ViewModels using

Using Notifications on android with MvvmCross

对着背影说爱祢 提交于 2019-12-09 10:29:15
问题 I do want to create a plugin which does implement something like a notification-service. So what I'm doing at the moment is something like this: var activity = Mvx.Resolve<IMvxAndroidCurrentTopActivity>().Activity; var builder = new NotificationCompat.Builder(activity.ApplicationContext) .SetContentTitle(title) .SetSmallIcon(Resource.Drawable.Icon) .SetContentText(message); var notificationManager = (NotificationManager)activity.ApplicationContext.GetSystemService(Context.NotificationService)

MVVMCross iOS: How to trigger RowSelected on a Custom TableViewSource using CreateBindingSet?

*爱你&永不变心* 提交于 2019-12-09 09:44:38
问题 My question is for MVVMCross in iOS. I have a custom TableView and a detailView. How can I bind my "showDetailCommand", so when user click on one of the rows on TableView with trigger RowSelected to switch to detailViewModel? Here is my code structure: public class SearchResultsViewModel: MvxViewModel { private MvxCommand _showDetailCommand; public IMvxCommand ShowDetailCommand { get { _showDetailCommand = _showDetailCommand ?? new MvxCommand(ShowDetailCommandHandler); return _showMapCommand;

MvvMCross Binding with format string

我的梦境 提交于 2019-12-08 16:42:08
问题 How can i add a format for a binding, that formats the bound value with string.Format or something similar? I saw in other threads, that you can pass a converterName. Does a converter for this issue exists? Where can i see a list of the standard converters of MvvMCross v3? I browsed the code shortly, but couldn't find something. I know that there could happen information lost which destroys two way binding, but i only want this for displaying values. My concrete case is Binding of a DateTime.

MvvmCross bind command with parameter in Windows Phone

穿精又带淫゛_ 提交于 2019-12-08 13:58:29
i am currently working on a simple app developped with Xamarin and MvvmCross. I have a simple list of items and i want a click on an item open a new view. I managed to do that in Android with : this code in the .axml of the view ListCustomersView.xaml <MvxListView android:minWidth="25px" android:minHeight="25px" android:layout_width="match_parent" android:layout_height="wrap_content" local:MvxItemTemplate="@layout/listcustomerscell" local:MvxBind="ItemsSource ListCustomers; ItemClick ShowCommand" android:id="@+id/listCustomersView" /> and this code in the ViewModel file :

Image Caching from http sources

◇◆丶佛笑我妖孽 提交于 2019-12-08 12:13:36
问题 I've read in a post from December 1st 2012 at Slodge bloch that File and DownloadCache plugins could be used for downloading and caching images from http sources. I think that's what I need in the app I'm trying to develop with MvvmCross (great framework, congratulations!!). My app, first connects to a remote server to download some basic configs. One of these configs points to an url to get the app icon. To save bandwith, I'd like app caches the icon the first time it gets it until the url