Can Prism6 UWP use Microsoft Composition (Portable class library version of the Managed Extensibility Framework) - win-universal-app

Latest Prism does not have support of MEF as DI container for UWP projects.At present unity and autofac are available DI containers for UWP Application.
Microsoft Composition (MEF 2) provide a Portable class library version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput.
Nuget package available for this MEF: Microsoft.Composition (MEF2 1.0.30).
If we provide MEF container concept for UWP, traditional WPF Applications which are MEF based will have more flexibility to move to UWP.
Can we use this portable class library and use MEF with Prism6 UWP and derive some MEF container concepts for UWP?

Of course you can. You just have to create an assembly that has support for your desired version of MEF. You can use one of the existing projects as a blueprint on how to create yours:
https://github.com/PrismLibrary/Prism/tree/master/Source/Windows10/Prism.Unity.Windows

Related

Developing C++ WinUI3 Desktop App with MVVM

I am looking at the WinUI3 framework with native C++ support for desktop applications.I cannot see any MVVM support as in C#. Should I expect it will be never supported and go i.e. with MVP with some code behind, or I am missing something?I cannot find any sample.
When you are talking about automatic tooling for XAML than you have to wait until 2024 to use it with C++. This is the estimated timeline from MS as they first hebr yo push a reflection API into the C++2023 standard.
But the MVVM fundamentals are perfectly working. Just write it out by hand and enjoy a developer experience last seen in 2006.
You can do MVVM by implementing interfaces such as INotifyPropertyChanged manually. Check out this sample which showcases how to implement the interface.
The cppxaml library (part of the unpackaged NuGet package) has been providing some help with MVVM though it's very barebones compared to MVVM frameworks available for .NET apps.

xamarin.forms integration of zendesk chat

I am new to Xamarin development. And, currently I want to integrate the zendesk chat.
As per my RnD and after contacting Zendesk support center they are not supporting the xamarin yet.
Currently they have sdk for native android and ios respectively.
I need you expertize people's guidelines for the development regarding what scenario i should follow to achieve the same using xamarin.forms :
Integrate the both platforms native sdk's for xamarin in each platform and later call it from Xamarin.Forms by adding platform dependency using Device.OnPlatforms . ( I am not sure about this scenario, please suggest)
Create a jar/aar of Zendesk SDK and use it using binding library concept.( I am not sure it will be accessible into ios platform)
Kindly, suggest me the best approach for this.
Any sample reference for suggestions will be grateful.
Thanks in advance.
I think it's a mix of number 1 and number 2 (and a little extra).
You will need to create the Binding libraries for both iOS and Android. Xamarin has a good documentation of how to do this: Android/Java and IOS/Objective-C
Then you can go either with Xamarin Native (Xamarin.iOS and Xamarin.Android projects) adding the binding to each project. Or you can go with Xamarin.Forms but this will require a little more work as you will need to create an interface of the methods you want to use from the SDKs (most likely all off them) and create the implementations for each platform.
Let's say your interface is called: ISendeskSdkService you will need at least two implementations: ISendeskSdkServiceiOS and ISendeskSdkServiceDroid. These implementations will be on the Platform project and they will be calling the binding libraries you just created and added to each of these projects.
You will be developing your app on top of your interface and which implementation to use will be set on the application load when you are configuring your IoC.
Hope this gives you an idea.

What is Class Libaray(iOS) in Xamarin?

Why there is a Class Library in Xamarin in iOS section "Class Library(iOS)" and what is difference between "Class Library(iOS)" and PCL Targeting Xamarin.iOS
Why we need this and what are the pros and cons
A Class Library is a project that creates a DLL file targeting a specific platform. An iOS Class Library creates a DLL for consumption by Xamarin.iOS projects only.
A Portable Class Library (PCL) is a library that can target multiple platforms, including Xamarin.iOS and Xamarin.Android, as well as Windows Phone and other .NET platforms.
If you want to share code between multiple platforms, you would use a PCL. If you are only interested in a single platform, use a platform specific class library.

MEF support on Xamarin.iOS

I am wanting to port a C# Mobile App for Windows 8 tablets using Xamarin. One of the issues we foresee is the use of MEF. Does Xamarin.iOS support MEF?
It depends on what you mean by MEF support. Using MEF assemblies is possible using Xamarin.iOS. What's not possible (iOS restriction) is dynamically loading code in your application (e.g. plugins).
You might be able to use MEF while ensuring there's not dynamic code being loaded, i.e. that everything is statically referenced and built inside a single binary executable (e.g. by ensuring every plugin is built-in).
Depending on your application that could prove useful (no, or less, need to modify your existing application) or not (if your app can't load/be built with all plugins). In the later case your problem is with iOS itself (not Xamarin).

MonoTouch: does it support MEF?

I am trying to port an existing c# .net application that is using MEF extensively to MonoTouch and MonoDroid. Does MonoTouch and MonoDroid support MEF?
Try using PocketMEF.
It is a subset of MEF that can run on PocketPC, WindowsCE, etc.
You will have to create a MonoTouch project from the source, because I would think there would be some minor changes to make it run in MonoTouch.
All the attributes and classes are named the same as standard MEF, you should only have to change a reference and a using statement with #if iPhone to get it working.
According to the list of MonoTouch assemblies and Monodroid assemblies, the MEF assembly (System.ComponentModel.Composition.dll) is not included.
It might still be possible to compile the MEF sources for these platforms, but this would probably require modifications to eliminate unavailable dependencies.

Resources