Xamarin not resolving DialogViewController - ios

I am trying to use the DialogViewController in Xamarin but it cannot resolve it within Visual Studio. The same goes for RootElement, Section and EntryElement. Any idea why it doesn´t recognize these elements?
Using Xamarin.iOS 9.4.1.24.

You need to add the MonoTouch.Dialog-1 assembly to your References. It isn't included by default.

Related

"MapView not found in Esri.ArcGISRuntime.Xamarin.Forms" error Xamarin Forms iOS

I am using ArcGIS Runtime 100.4.0 in my Xamarin forms solution which is consist of
Android Project
iOS
.Net Standard 2 project (shared logic used by android and ios)
My code is very simple and it only tries to display a map. I used the code from Esri example for displaying a map and I already have it working in another project where the app logic is in a Visual Studio Shared Project (instead of .net standard). The Esri sample project also uses Visual Studio Shared Project. I think the issue that I am facing can be resolved by using Visual Studio Shared Project but for some technical reasons I have to use .Net Standard for my shared logic.
Now here is the issue:
The android app shows the map without an issue, however in my iOS app, I get the following error in my .net standard project when the app tries to initialize the map:
MapView not found in xmlns clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms
I am confident that I have all right references in my iOS project and also the fact is the error happens in the .net standard project which is working in my Android app.
How is it possible to be missing MapView class when using my .netstandard project in iOS but not android?
While I was investigating this I found a solution which I have no clue about the reason:
I added a line before InitializeComponent() in my page code behind which simply creates an instance of Esri.ArcGISRuntime.Xamarin.Forms.MapView, and that fixed it:
public MapPage()
{
var a = new Esri.ArcGISRuntime.Xamarin.Forms.MapView();
InitializeComponent();
}
If I remove that line I get the error again in iOS. I have no idea why that happens

Reference to type 'System.IConvertible' claims it is defined in assembly mscorlib

Anytime I try to reference an NUNIT data type in the iOS framework, I am given a compiler error saying it can't find the IConvertible type
Error CS7069: Reference to type System.IConvertible' claims it is defined assemblymscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089', but it could not be found (CS7069) (logic)
I was able to reproduce this by creating a brand new Xamarin.Forms project that only targets iOS.
Immediately after creating it, I added a second Xamarin.Forms project, this time a PCL.
I then needed to add the Xamarin.iOS library so that I can reference the iOS specific APIs, specifically the Photos API. I did this by navigating to
~/Library/Frameworks/Xamarin.iOS.framework/Versions/9.0.1.29/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
Lastly, I added a blank class to the new PCL project, and created a locally scoped NUNIT field. This is where the compiler error happens. This happens in my current project when I try to get the number of photos in a PHAssetCollection, as that is an NUNIT data type.
using System;
namespace logic
{
public class EmptyClass
{
public EmptyClass()
{
nuint test = 5;
}
}
}
This gives me the compiler error I've referenced above. How can I solve this? This has become a blocking issue for me, am I referencing the wrong Xamarin.iOS.dll? It's not available in the list of nuget packages when I scan for them, so I can't add it via NuGet. NuGet only has Xamarin.Forms.dll available.
Update 1
After trying a few different combinations, I think that I have a working solution. Instead of creating a Xamarin.Forms Library, I created a normal iOS PCL library instead. This solved that problem.
I don't know why the Xamarin.Forms library wouldn't work. Is it not intended to be used for platform specific code?
Xamarin Forms PCL's need to be platform agnostic. If you have a NUnit project that needs access to a Xamarin.iOS specific reference, then you need to build within the iOS project / iOS PCL.
Xamarin.iOS.dll can only be referenced from a iOS related project.

MvvmCross DownloadCache plugin breaks bindings in custom controls on Android

I've wanted to use DownloadCache plugin in my MvvmCross project, but when I've added this package from nugget it broken bindings in custom controls on Android.
I'm using MvvmCross v.3.1.1
I have tried:
Updating MvvmCross and all plugins to v.3.2.2, but this did't helped.
Using target bindings instead of custom control properties, this has helped me, but this solution is not satisfying, because I have lots of custom controls where bindings are broken.
Also I can see an error in output saying:
MvxBind:Warning: 41,01 Failed to create target binding for binding ControlProperty for ViewModelProperty
Thanks for any help.

MVVMCross PictureChooserTask load exception

I am creating an Android project with MVVMCross and Xamarin on Mac using Xamarin Studio. Everything has been going terrific until I got to needing to use the camera. I downloaded and installed the PictureChooserTask plugin. The issue I am having is after adding the dll's to the Android project and calling:
Cirrious.MvvmCross.Plugins.PictureChooser.PluginLoader.Instance.EnsureLoaded ();
I now can't run the application. It fails during startup with the following error:
Missing method AddOrOverwriteFrom in assembly .override/Cirrious.MvvmCross.Plugins.PictureChooser.Droid.dll
The solution that worked for me was to just manually register the singleton type using the following:
Mvx.RegisterType<IMvxPictureChooserTask, MvxPictureChooserTask> ();

GridView for Monotouch

I am trying to get a Visual Studio's gridview like control for Monotouch development. I had a look at AQGridView. Does AQGridView works with Monotouch? Is there a library for AQGridView which I can add to my monotouch project?
You should be able to use about any Objective-C library with MonoTouch.
You will just have to setup a MonoTouch binding project in order to use it.
Here is a link to another answer of mine that goes over it: OpenFeint with MonoTouch
Also read the Xamarin docs: http://docs.xamarin.com/ios/advanced_topics/binding_objective-c_types
Another UI library to look at is Three20. It's used in a lot of apps, like Facebook and Dropbox, etc.
I have created MonoTouch bindings for the AQGridView that should meet your needs.
https://github.com/theonlylawislove/MonoTouch.AQGridView
Just include the .csproj inside of your solution and add a reference to it.

Resources