Developing C++ WinUI3 Desktop App with MVVM - windows-10

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.

Related

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.

Is it possible to embed xamarin part into an existing native app?

I have existing iOS and Android native apps. Is it possible to extend the apps with Xamarin coded part ?
Both Xamarin.iOS and Xamarin.Android are currently setup to take control of your application, so you need to make your main program be written in C# and then call into the existing code.
The way that you would do this is to bind your existing Objective-C or Java code as C# libraries, and then consume those libraries from C#. The binding technology is precisely what drives both the Xamarin.iOS and Xamarin.Android tools, so you would effectively be doing the same.
Once you have bindings, the interoperability works both ways: you can call native code, and native code can call C#.
The bad news is that instead of starting to enjoy writing code with both tools from day zero, the first thing you have to do the bindings, which is in general, not as fun as watching colored squared move on your screen.
Ok I find an answer here : http://www.whitneyland.com/2013/05/why-i-dont-recommend-xamarin-for-mobile-development.html
For example, code written in Xamarin cannot be used in native or HTML5
apps.

Is it possible to compile MonoTouch projects with languages other than C#?

How would I go about using F# or J# for instance? I'm not sure what to get to grips with in the project's compiler settings.
Is there a sequence of command line steps I could follow to compile a MonoTouch project that I might interpret to replace the C# step but tell the other compiler to use the correct platform details etc?
Thank you.
Unfortunately, no. In the book "Developing C# Apps for iPhone and iPad using MonoTouch" you could see text (proof):
C# Is Currently the Only Language
Additionally, currently, the only .NET language available for writing MonoTouch applications is C#.
Nothing changed since that book publication.
Maxim Korobov is right, MonoDevelop only supports C# when writing for MonoTouch.
But this is not the whole truth: MonoDevelop also has (preliminary) support for Portable Library Projects (PLP). What this means is that you can create and compile PLP projects in Visual Studio (in any language Visual Studio supports for PLP projects), and then reference that library in MonoDevelop. Just have in mind that the PLP support is preliminary right now, and you might run into a few bumps on the way.

Standard Architecture for Building Metro apps

I am new to Metro apps...and have been developing on WPF(MVVM) for some time...
I also saw that WPF like Binding Engine is also there with Metro apps ..
So here i ask a few question ..
What is a suitable architecture to develop a maintainable Meto app.
Is it
1) MVC
2) MVVM
Are there any framework that could be used to develop the same using the above Architectures.
Can MEF be used with mero apps (I dont think so but still need to confirm).
MVVM is a totally fine choice and a MVVM Light for WinRT is available. In regard to MEF there is a SO question that elaborates on this ( How to load/import dll with MEF out of metro app? )
Edit:
MVVM Light Download for Windows 8 http://mvvmlight.codeplex.com/releases/view/88894
Announcement: http://blog.galasoft.ch/archive/2012/06/03/mvvmlight-v4-for-windows-8-rp-is-available.aspx

Use CoreData in MonoTouch?

I have seen that there are so wonderful ways in Xcode to design your CoreData models - is there a way to make use of this and CoreData in general in MonoTouch 5?
Any tutorials or examples?
Maybe is not the direct answer to your question but might be what you are looking for:
Sqlite-net is an open source, minimal library to allow .NET and Mono applications to store data in SQLite 3 databases. <- the one you are using but for future reference
Vici CoolStorage is a fully typed Object Relational Mapping library for .NET 3.5, Windows Phone, MonoTouch and Mono for Android
Catnap is a basic lightweight ORM for .NET. It uses the ADO.NET API. The project includes an adapter for Sqlite, and it is tested with System.Data.Sqlite and Mono.Data.Sqlite.
MonoTouch.SQLite An abstract UITableViewController to make displaying data from an SQLite table simpler.
Entify is entity framework for desktop and mobile applications. It aims to be stable and easy-to-use library that is effortless to deploy with any application. It has visual designer which allows developer to define application data model easily and quickly.
Just a side note on entify, it has not been updated since Apr 11, 2010 so idk if it still works
The only thing I could find about MonoTouch and CoreData was this blog post.
Hope this helps.
Alex
Here is the documentation for CoreData in Mono.
This blog post is almost two years old, but the only example I could find of using CoreData in Mono.
Most relevant to your question, however, this bug/request is for integrating Xcode's tools into Mono. It doesn't seem to even be under development yet.
Edit:
You can also use /Applications/Xcode.app/Contents/Developer/usr/bin/momc <source xcdatamodel> <absolute path to target> to generate the .momd. I'm still working on getting it integrated better - see this question.

Resources