mvvmcross

MvvmCross Android ViewStub

瘦欲@ 提交于 2021-02-11 06:53:23
问题 I recently found a class called ViewStub that can be used to "lazy-load" a layout-resource. The usage is very straight forward: In the layout file I use: <ViewStub android:id="@+id/content_stub" android:layout_width="match_parent" android:layout_height="match_parent"/> And in my code: var stub = this.FindViewById<ViewStub>(Resource.Id.content_stub); stub.LayoutResource = Resource.Layout.FirstView; stub.Inflate(); However, this way the Bindings won't work! I know, that using mvvmcross I have

Xamarin forms open view model on notification tap

若如初见. 提交于 2021-02-08 05:38:15
问题 I am using this code to show notification in notification bar. When the notification is tapped, main activity is launched. Is it possible to launch the view model instead of activity in Xamarin forms app with MvvmCross. Intent notificationIntent = new Intent(context,typeof(MainActivity)); notificationIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent pIntent = PendingIntent.getActivity(context, code, notificationIntent, PendingIntent.FLAG_UPDATE

How is MvvmCross initialized in a notification service when app is closed and notification is received?

馋奶兔 提交于 2021-02-08 05:18:28
问题 I've created a service in my application that listens for push notifications from GCM. The service's OnMessage method gets called correctly in all scenarios that I've tested: app running in foreground, app running in background and app not running. However, when the app is not running, the code is throwing a NullReferenceException when I try to resolve dependencies with Mvx.Resolve . Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at

How is MvvmCross initialized in a notification service when app is closed and notification is received?

我怕爱的太早我们不能终老 提交于 2021-02-08 05:16:53
问题 I've created a service in my application that listens for push notifications from GCM. The service's OnMessage method gets called correctly in all scenarios that I've tested: app running in foreground, app running in background and app not running. However, when the app is not running, the code is throwing a NullReferenceException when I try to resolve dependencies with Mvx.Resolve . Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at

MVVMCross - display view inside view

久未见 提交于 2021-02-04 21:35:44
问题 I cannot seem to find any simple examples of this. I have a WPF UI that I wish to display a view as a child control within another view. The MvxWpfView inherits from UserControl so it should be possible, however I cannot seem to work out how to do the binding. I get a BindingExpression path error, as it cannot find ChildView property in my ParentViewModel. So how do I bind a view to control content? 回答1: Firstly it's possible that you just need to add the BViewModel you want displayed on

MVVMCross - display view inside view

你。 提交于 2021-02-04 21:34:15
问题 I cannot seem to find any simple examples of this. I have a WPF UI that I wish to display a view as a child control within another view. The MvxWpfView inherits from UserControl so it should be possible, however I cannot seem to work out how to do the binding. I get a BindingExpression path error, as it cannot find ChildView property in my ParentViewModel. So how do I bind a view to control content? 回答1: Firstly it's possible that you just need to add the BViewModel you want displayed on

Wpf Multiple nested Usercontrols with MvvmCross

大城市里の小女人 提交于 2021-01-29 20:24:25
问题 I'm pretty new in MvvmCross but I'm working with mvvm for awhile. I know how to compose usercontrols with nested usercontrols. Now with mvvmcross I got stucked to show two or more usercontrols in another usercontrol. I don't use any other framework than MvvmCross . My Rootview looks like this: `<views:MvxWpfView x:Class="MvvmCrossTest.Wpf.Views.RootView" xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf" xmlns="http://schemas.microsoft.com/winfx/2006

how to call MvxDialogViewController as a popover

不打扰是莪最后的温柔 提交于 2021-01-29 18:16:37
问题 I am trying to display MxxDialogViewController from a popover and am getting an exception 18.35 Request is null - assuming this is a TabBar type situation where ViewDidLoad is called during construction... patching the request now - but watch out for problems with virtual calls during construction while calling base.ViewDidLoad() here is what I did to demonstrate the problem as a small sample: I took N-23 example and added to the first section a new element with the Tapped command new

How to update badge counter in Parent tab page xamarin forms

佐手、 提交于 2021-01-29 12:53:43
问题 I have a App that uses tabbed pages, In the xaml of the Parent tab page I populate all my other tab pages, I have a viewmodel that binds to the Parent tab page and viewmodels for each of the other Tab pages. I have a badge on one of the tabs that has a counter which shows how many messages there are. I am having trouble updating the counter. So I have a call to retrieve the amount of unread messages from the database which is populating into the counter on app load. When i Navigate to view

How to use MvvmCross without storyboards in iOS?

浪尽此生 提交于 2021-01-28 19:39:02
问题 When I was using MvvmCross 5, I coded all my views and avoided using storyboards for my iOS app by writing this in my AppDelegate : [Register("AppDelegate")] public class AppDelegate : MvxApplicationDelegate { private MvxIosViewPresenter viewPresenter; public override UIWindow Window { get; set; } /// <summary> /// MvvmCross Mods: /// - Creates a new presenter, which determines how Views are shown /// - This example uses a standard presenter. /// </summary> /// <param name="application"><