Using MVVMCross IoC with Link All Assemblies - mvvmcross

I'm just reading up about the inbuilt IoC of MVVM Cross and how it makes heavy use of reflection. Just wondering, does this cause issues with Xamarin linking? What are people finding best practise in this area? Using "Link SDK assemblies only" or perhaps configuring IoC in a way that avoids reflection?
Thanks in advance :-)

Both MvvmCross IoC and MvvmCross binding rely on Reflection.
Because of this, users often use "Link SDK assemblies only" and often use "LinkerPleaseIgnore" files.
You can read more about this on:
https://stackoverflow.com/questions/10224376/mvvmcross-experiences-hindsight-limitations/10225623#10225623
Problems with mvvmcross Binding on IOS (Works on Simulator, but some properties doesn't work on the Device)
... and many more https://stackoverflow.com/search?q=[mvvmcross]+linker
The MvvmCross nuget packages ship with default "LinkerPleaseIgnore" files - e.g. https://github.com/MvvmCross/MvvmCross/blob/v3.1/nuspec/TouchContent/LinkerPleaseInclude.cs.pp

Related

Can mvvmcross be used without dependency on Xamarin?

Being familiar with mvvmlight, I'm now starting to look into using mvvmcross instead given the nice ability to use it with Xamarin to eventually also support my code on ios and android. However, I'm not there yet and would like to avoid taking a dependency on xamarin as long as I'm not actively targetting platforms other than WP8.1 and Win8.1.
Question: can mvvmcross be used without dependency on xamarin? (From my research so far my understanding is that mvvmcross is closely linked to usage with xamarin; even to the extent they share libraries? Would love to understand to what extent there's a hard dependency.)
As an alternative approach is there anyone successful in using mvvmlight for cross platform dev?
Kind regards
Yes it can - the core of MvvmCross is PCL - it's portable.
Xamarin is used only for Xam.Android, Xam.iOS and Xam.Mac - you can use WP, WinRT, WPF, MonoMac, Unity, etc without any Xamarin products.

Debugging MvvmCross application in Xamarin Studio with MvvmCross sources

I'd like to be able to step through the MvvmCross sources in the debugging of a MvvmCross application.
And I want to keep the process of keeping the MvvmCross library up-to-date simple. Currently the MvvmCross project files cannot even be openened in Xamarin Studio without editing lots of .csproj files (due to some PCL/project platform issues).
I've found that using the MvvmCross-Binaries assemblies (and their .pdb and .mdb files) and putting their source code into "C:\Projects\Misc\MVVMCROSS" does the trick. You can even step through the sources and set break points.
That is not the most self-contained solution.
I am wondering, if there is a better way.
MvvmCross now contains the symbol packages so you can debug it: https://github.com/MvvmCross/MvvmCross/pull/889

How targeting .NET 4.0 with Mvvmcross?

I want to use Mvvmcross to make application for several platforms.
I use Profile 104 for PCL library like Mvvmcross, but this profile target .NET 4.5.
I want to target .NET 4.0 to use my application on Windows XP.
To do that, I add the xml files
MonoAndroid, Version = v1.6 +. Xml
and
VSMonoTouch, Version = v1.0 +. Xml
in the profile 143 which allows me to target. NET framework 4.0.3.
However, I have a compilation error because it can not find the ICommand interface.
This interface is not in the same library between version 4.0 and 4.5, is it why it doesn't work ?
Or should I recompile all Mvvmcross libraries with profile 143?
thanks,
This is a Portable Class Library limitation.
See the table on: http://msdn.microsoft.com/en-us/library/gg597391.aspx
Model-View-View Model (MVVM)
Only 4.5
This means that if anyone wants to use MvvmCross on earlier .Net platforms then someone has to build and maintain a non-PCL version.
Since the maintainer of Mvx (me!) has decided to only maintain PCL versions of MvvmCross, then any non-PCL support will have to be created by the community.
For WPF this shouldn't be too large or difficult a job - but it might be...
Alternatively, somebody might be able to do something funky to get the ICommand working... I've retagged this question with portable-class-library to try to lure in some of the MS experts.

building the interface of an eclipse plugin with JavaFX or HTML5?

I am looking for an alternative to swt for building the interface of an Eclipse plugin I want to develop.
Is it possible to build the interface of the plugin with JavaFX or HTML5 instead of swt ?.
I am targeting Eclipse Juno 4.2 or later.
Eclipse 4 defines an application model, i.e. a model of all the parts forming the application UI. The application model is decoupled from its presentation.
This means that different UI toolkits (SWT,XWT,JavaFX,etc.), can be used to implement the model. Theoretically you can build a UI using any presentation technology you want.
That said, Eclipse 4.2 (the IDE) still relies on good ol' SWT for it's UI. Which means, your plug-in will require some additional dependencies to be able to use a different toolkit.
e(fx)clipse (already mentioned by jewelsea), provides the necessary Eclipse tooling to build your plug-in. Among other things it plugs a JavaFX ViewPart plug-in template, which creates an example plug-in and adds the necessary bundle dependencies for you.
Imho, this would be your best bet.
There are lots of things going on, Eclipse versioning can be a bit confusing nowadays (at least for me), you can take a look at E4 but it is not widely used. It has the ability of desining UI with Eclipse RCP/CSS.
An other posibility is XWT. I've seen some business ready application using XWT so it seems to be mature enough. Even WindowBuilder can be used to build UI with XWT. Which is actually declarative UI constructing with XML. If you want to have only the OSGi "goodies" you can take a look at Apache Felix or Eclipse Virgo (Spring-powered). They are application servers based on OSGi so you can build module based enterprise applications.
Last but not least if you are OK with SWT/JFace but want to have web application, take a look at RAP. I have seen a full RCP application converted to RAP running in a regular browser.

Can I add winRT project reference to classic class library project?

VS gives me errors when I try to do it. Yet, it displays such projects as available to reference. Is it possible to add winRT project reference to the classic class library project somehow?
If not, how to bridge both worlds, so common logic can be stored in one place?
The short answer is yes. The long answer is that it's not supported and comes with some caveats that you need to understand.
See my answer here:
Using Custom Windows Runtime Components in Non-Metro Applications
VS2012 adds a "Portable Class Library" project type that allows you to select multiple targets, including the ability to target WinRT and full .Net 4.5 from one assembly.
See http://msdn.microsoft.com/en-us/library/gg597391.aspx.