MvvmCross - 4.0 Beta 3 doesn't work with new UWP project? - xamarin

I started a new Windows 10 UWP project today and used Nuget to add references for the beta version of MvvmCross. After adding references to MvvmCross and some HotTuna plugins (like StarterPack), all I get is the following:
I seem to be missing some stuff because I'm unable to inherit from MvxStorePage. Also, when I added HotTune to my Android project, a ToDo.txt file was added with instructions, but in the UWA project, I didn't get any of those extra files.
Am I doing something wrong?

I don't think you can inherit from MvxStorePage, because it doesn't exist in the namespace available to UWP project.
In UWP project, the Cirrious.MvvmCross.WindowsUWP namespace is used. You can check it in Visual Studio in "Class View (Ctrl + Shift + C)". And the only available view is MvxWindowsPage as below.
Based on the Universal Windows App tutorial on GitHub, the MvxWindowsPage is recommended to be used in universal app. Note that, the tutorial is for Universal Windows app for 8.1, but it's same to make it work in a win10 UWP app. Just change the namespace from Cirrious.MvvmCross.WindowsCommon.Views to Cirrious.MvvmCross.WindowsUWP.Views. By doing that, I didn't get any problem to inherit from MvxWindowsPage.

Related

No portable class library folder found in Xamarin Forms

I am a newbie working with Xamarin Forms in Visual studio 2019.
When I create a blank page for Mobile App(Xamarin.Forms) , I do not see a Xamarin.forms portable template app in my project solution.
There is no PCL anymore. PCL is outdated. Just use the Mobile App (Xamarin.Forms) template. It will create all you need.
The core project (that contains your shared code) will be a .net standard project.
.net standard is way better than PCL, because you don't have a artificially limited set of APIs.
this creates the following 3 projects
Your shared code should go into the App8 project

Cannot find "cross-platform using PCL" while creating a xamarin app

I want to create a xamarin cross platform using PCL. I do not find this option while creating a project. Am I missing any installations?
Is "Xamarin.UITest Cross Platform Test Project" similar to that? But that does not open Android and IOS directories in it
The PCL option is deprecated .
From the official documentation:
Portable Class Libraries (PCLs) are considered deprecated in the
latest versions of Visual Studio. While you can still open, edit, and
compile PCLs, for new projects it is recommended to use .NET Standard
libraries to access a larger API surface area.
If you wan't to create a Xamarin.Forms solution, you must select the Mobile App (Xamarin.Forms) template. Nowadays, everything moved to .netstandard 2.0

Multiple errors after updating Xamarin Forms

I'm using Visual Studio 2017, and I stared a new Xamarin Forms app:
Create New project - Cross Platform App (Xamarin)
Blank App, and I chose Portable Class Library (PCL)
The app compiles and runs.
Now I right click the solution and choose Manage Nuget packages for solution, and it tells me I'm running version 23.3.0 and I should update to 25.4.0.1
After the update and 3 VS reboots, it gives me a host of errors I have been trying to solve for an hour including googling.
All theme related.
I tried removing the styles.xml file all together. I removed the theme from the reference to the theme from the manafest and it keeps putting it back.
I can't figure out what I'm doing wrong. I have not written any code.
Xamarin Forms requires a specific version of the Android Support libraries. Do not update them.
Delete your project and create a new one.
It is possible to get round this limitation by ensuring you are using a specific version of Android and by updating all Android SDK's, but for a beginner I would recommend just using the support libraries that are installed alongside Xamarin Forms.

How to load PCL's App class from Win Phone 8.1 RT project

I'd created a Windows Phone 8.1 Project into an existing Xamarin Forms solution (Android, iOS and UWP). I'd followed instructions from Xamarin Documentation pages, but still unable to find "LoadApplication()" method. I'm using Visual Studio 2015, and the Project has .NET Framework 4.5 on her profile.
The Xamarin.Forms.Platform.WinRT namespace hasn't the necessary class.
I have tried to create windows phone 8.1 client project following "Adding a Windows Phone App". It is working pretty well. You may miss some key procedure.
I have tested if you miss step two(right-click on the newly created project...)and step five(Edit MainPage.xaml...) in the article mentioned above, you will unable to find LoadApplication() method.
The code sample has uploaded to github,You could refer to my code sample and verify difference between this two. So that you could find the missing procedure.

Can not compile after migrating unified api in xamarin forms

We have migrated the xamarin forms project to unified api.
But we have the strange compile error like this:
Could not AOT the assembly '.../iOS/obj/iPhone/Debug/mtouch-cache/Build/Xamarin.Forms.Labs.dll
So I changed the settings in iOS project's options.
In ios Build Tab of Project options(iOS) I changed the "don't link" to "Link all assemblies".
But the app is crashed when it is started.
xamarin version is 5.7.1(build 17).
xamarin forms's version is 1.3.5.6337.
xamarin forms labs's version is 1.0.1.5.
Please help me if you have the experience with this error.
Replace Xamarin.Forms.Labs with XLabs.Forms.
There has been a major refactoring on how the XLabs project is structured so your existing project based on the 1.x.x will break. The reason for the refactoring was simple; separate functionality that does not depend on Xamarin.Forms into different assemblies. This allows the use of functionality like IoC, Serialization and even platform specific services without referencing XF.
To upgrade:
Uninstall any existing Xamarin.Forms.Labs packages from your
project.
Install XLabs.Forms package to your projects (PCL, iOS, Droid & WP). This will update Xamarin.Forms to the latest stable release (1.4.x)
Refactor code to reference the correct namespaces.

Resources