mvvmcross

How to use CanExecute with Mvvmcross

丶灬走出姿态 提交于 2019-12-29 07:36:25
问题 I have a Button <Button android:id="@+id/ButtonConnect" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Disconnect" local:MvxBind="{'Click':{'Path':'DisconnectCommand'}}" /> And I have a Command for it public IMvxCommand DisconnectCommand { get { return new MvxRelayCommand(this.GetService<IConnectionService>().Disconnect); } } Then I want to enable/disable the DisconnectCommand using DisconnectCommand.CanExecute(this.GetService<IConnectionService>()

Custom types in Navigation parameters in v3

只谈情不闲聊 提交于 2019-12-28 16:16:05
问题 In v3 if I wanted to pass two objects to another viewmodel: public class Dog { } public class Cat { } var dog = new Dog(); var cat = new Cat(); ShowViewModel<SomeViewModel>(new {Dog = dog, Cat = cat }); public class SomeViewModel { Init(Dog dog, Cat cat) { } } As far as I can tell that won't work because the types aren't recognized and can't be stuck in a dictionary. If I wanted to have these serialized as json, passed to the view model, and deserialized as Init parameters, would I implement

MVVMCross ViewModel construction failure notifications

元气小坏坏 提交于 2019-12-25 12:58:05
问题 We've noticed a couple of times in our mobile applications that users have reported the application hanging or seeming to become unresponsive between views / rare crashes when switching between views. We've tracked down these cases to when our view model constructors throw uncaught exceptions. We want to put a solution in place so that if a view model fails to construct for some reason then we can notify the user and provide some message that will be useful to us when it's logged through

System.FormatException in MVVMCross

最后都变了- 提交于 2019-12-25 09:54:40
问题 The following code updates properties on-the-fly via mvvmcross messaging protocol. The problem that I am facing now, when user clears either age or category textviews, then I am getting systemformat exception, I guess when textview gets blank, it does not parse it to a number? System.FormatException: Input string was not in a correct format. MainViewModel private readonly IMvxMessenger _messenger; private readonly MvxSubscriptionToken _token; public MainViewModel(IMvxMessenger messenger) {

System.FormatException in MVVMCross

故事扮演 提交于 2019-12-25 09:52:23
问题 The following code updates properties on-the-fly via mvvmcross messaging protocol. The problem that I am facing now, when user clears either age or category textviews, then I am getting systemformat exception, I guess when textview gets blank, it does not parse it to a number? System.FormatException: Input string was not in a correct format. MainViewModel private readonly IMvxMessenger _messenger; private readonly MvxSubscriptionToken _token; public MainViewModel(IMvxMessenger messenger) {

System.FormatException in MVVMCross

我与影子孤独终老i 提交于 2019-12-25 09:51:59
问题 The following code updates properties on-the-fly via mvvmcross messaging protocol. The problem that I am facing now, when user clears either age or category textviews, then I am getting systemformat exception, I guess when textview gets blank, it does not parse it to a number? System.FormatException: Input string was not in a correct format. MainViewModel private readonly IMvxMessenger _messenger; private readonly MvxSubscriptionToken _token; public MainViewModel(IMvxMessenger messenger) {

How to resolve IMvxApplication (which inheritor is defined in separate assembly (not Core one))?

∥☆過路亽.° 提交于 2019-12-25 05:37:04
问题 I have usual MyApp.Core project . However, I also have General.Core project which includes some general code for apps and services shared through different projects (different mobile applications). In General.Core project I have: public abstract class App : MvxApplication and also some service defined also on General.Core. I also have public abstract class SomethingApp : App in MyApp.Core (and then in every of Touch, Droid - further inheritance). However, when I try to get to my App from the

Cannot install mvvmcross download cache pluguin with xamarin forms

余生颓废 提交于 2019-12-25 04:24:53
问题 Mvvmcross version 4.4.0 xamarin forms need Xamanarin.android.support.v4/v7.x version 23.0.0 Download Cachè plugin need Xamarin.android.support.compat version 24.2.1 My app is using xamarin forms so i cant remove it, but i also need to use MvxListView to show an image from url with local:MvxBind="ImageUrl myimage" so i need download cache plugin, but i cant install it. Is there any other IMvxImageHelper to use instead of MvvmCross-DownloadCache plugin ? or any other solution ? *IMPORTANT NOTE-

Mvvmcross bind to Visibility with autolayout and fully hide view

风格不统一 提交于 2019-12-25 04:22:54
问题 Currently binding to "Visibility" sets Hidden=true. How would you create a generic Visibility binding which also changes a constraint: sets the view height to 0 ? 回答1: For a tutorial on creating bindings, see the N=28 video on http://mvvmcross.blogspot.com/ To replace the existing visibility binding, simply create your own class based on https://github.com/MvvmCross/MvvmCross/blob/v3.1/Cirrious/Cirrious.MvvmCross.Binding.Touch/Target/MvxUIViewVisibleTargetBinding.cs public class

MvvmCross : ViewModel Navigation in code

青春壹個敷衍的年華 提交于 2019-12-25 04:22:49
问题 I got 3 ViewModels. FirstViewModel, SecondViewModel and ThirdViewModel. I want to click a button in FirstViewModel, then it will open SecondViewModel. After SecondViewModel is opened, without any user interaction, ThirdViewModel will be opened by code. I couldn't get the ThirdViewModel to open automatically. using Cirrious.MvvmCross.ViewModels; namespace PortableClassLibrary1.ViewModels { public class FirstViewModel : MvxViewModel { private string _hello = "Hello MvvmCross 1"; public string