mvvmcross

Mvvmcross Android - Rotating fragment view during viewmodel population

空扰寡人 提交于 2019-12-11 07:17:56
问题 I'm having a problem when I try to manually re hydrate fragment viewmodels while rotating. Everything seems to work fine when I rotate a fragment once my viewmodel has been populated, all I do is : this.viewmodel = foo but if I try to rotate the fragment during population (e.g. from a web service) and then re-attach the stored viewmodel before population has completed the view doesn't appear to bind properly. I know there is a lack of source (in this post) but I was wondering whether this

Display Error or Information from ViewModel to View

廉价感情. 提交于 2019-12-11 06:48:33
问题 How to display an Error or information (Toast,Message Box..) from view model to view. Note: I am developing a cross platform application for Droid,Touch and Wp8. 回答1: There are several ways to do this: Use a messenger or a custom object/event chain to send the error event notification to the UI. This is shown in https://github.com/MvvmCross/MvvmCross-Tutorials/tree/master/Sample%20-%20BestSellers/BestSellers and discussed in Alerts or Popups in MvvmCross Provide and use a "dialog service" -

MvvmCross: Android Application attribute

一个人想着一个人 提交于 2019-12-11 06:39:33
问题 When using MvvmCross for Android, where is the actual Application object normally used by Android? This object is not always needed unless you want to customize the tag in the manifest. Mono for Android has a ApplicationAttribute that you can use to decorate the Application class and change themes, icons, etc. How would I do this when using MvvmCross? 回答1: MvvmCross sits on top of Xamarin.Android So you can customise an MvvmCross Android application in exactly the same way as you customise a

Connecting MVVMCross Portable connect to WCF DataService. Is it possible?

ぃ、小莉子 提交于 2019-12-11 06:38:19
问题 I need your advice people. I am writing an engineering work project in VS2012 about used car dealership. I have a SQL Database, WCF DataService, WPF application (which is connected succesfuly to WCF) and wanted to create Mobile version for it too. I chose MVVMCross Portable to create Mono For Android and WP7 app with one core. And I have problems here with connecting to my WCF DataService from mobile portable core like: Unable to add a service reference to the specified OData feed because WCF

Several item templates in one listbox in mvvmcross Android

坚强是说给别人听的谎言 提交于 2019-12-11 06:37:52
问题 I use MvvmCross framework. I want to use different item templates in one listview depending on ViewModel type. For example I have the list of AnimalViewModels. And I want KittenViewModel and PuppyViewModel look different. I found out how to do this in iOS and WP7. How to implement this in Android. Thank you 回答1: A few of the samples show how to use cell type selection. See: polymorphic lists in https://github.com/slodge/MvvmCross-Tutorials/tree/master/Working%20With%20Collections grouped

How to bind view model to a UserControl in MVVMCROSS?

℡╲_俬逩灬. 提交于 2019-12-11 06:16:02
问题 I am using the excellent Mvvmcross and Ninja Coder for Mvvmcross for building a cross platform app. For my windows store app I have created a view and a view model using Ninja coder. I have also created a UserControl which will be referenced in the view. Hence I need to bind the same viewmodel to the User control also. I have been trying to set the Data context of the user control to the singleton instance of viewmodel. I have set the data context of the user control like below. public sealed

ListItems in MvxListView bind inconsistently with Items in MvvmCross 6.4.1 after Upgrading

ε祈祈猫儿з 提交于 2019-12-11 06:02:42
问题 As the title indicates, I am in the process of upgrading the dependencies of an existing Xamarin.Android project. The Android project uses MvvmCross for much of the cross-platform code (we support other platforms as well). As part of this upgrade, we are moving from MvvmCross 6.2.2 to 6.4.1. We are currently building the app with Visual Studio 2019. However, after upgrading, I have noticed that many of my project's layouts no longer bind under as consistently as they did when running. For

Back Button missing from nested Monotouch Dialog RootElement Views

↘锁芯ラ 提交于 2019-12-11 05:29:34
问题 I have two levels of nested RootElements and at neither level is there a Back Button. Two things to make clear Yes, I am overriding the DialogViewController and setting "pushing" to True I am adding the DialogViewController's View as a SubView in my MvxViewController rather than having the using the DialogViewController as my main controller I have a number of SubViews in my ViewController including a UITableView and a custom UIView. I want to use the convenient nesting of Controllers that MT

Where to listen for broadcast action with MVVMCross

夙愿已清 提交于 2019-12-11 05:15:55
问题 Making my Bluetooth application I need access to some broadcast actions on the Android side of my code. All this is run in my Core, so I have a ViewModel that will call through my interface public interface IConnectionService { //Properties string IntentName { get; } //Events event EventHandler<SearchConnectionItemEventArgs> SearchItemFoundEvent; //Methods void RunIntent(); void SearchConnection(); void Connect(string macAddress); } RunIntent prompts the user to turn on Bluetooth (Could be

In which context ICommand and Local:Mvx are prefered

主宰稳场 提交于 2019-12-11 04:25:53
问题 I'm developing an Android application using Xamarin and MvvmCross. As seen in the layout posted at the bottom of this question I have a TextView and a Button . I want to achieve the following things: Bind the OnClick listener of the button to the onClikCommand method as shown in the code below. When the onClikCommand is called I expect the value of the Text attribute of the TextView to change according to the evaluation of the if-statement. Broadcast the value of the evaluation via a