Have you heard the BIG news? Visual Studio for Mac was announced just a little before Microsoft Connect(); and it is already available for download from here. What exciting times are coming! We were very excited, just like you, to try it out, together with Telerik UI for Xamarin.
First, I should say that, as a guy acquainted with both Visual Studio (for Windows) and Xamarin, I found the fact that Visual Studio for Mac actually resembles Xamarin Studio very appealing. So, you get both the easy-to-start experience coming from working in an already known environment and the confidence that this environment will continue to evolve and grow. I should also say that I am thrilled by the ability of the new version to show design-time for Forms. Custom native controls seem to be unsupported in the Preview version out-of-the-box, but I expect this to get improvements too.
Let’s now get straight to the point. What I will do now is first create a new project and then add the Telerik UI for Xamarin references using the NuGet server that we provide. Then, I will add our Calendar control and will run the app.
this
.Content =
new
RadCalendar();
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
Foundation;
using
Telerik.XamarinForms.Common.iOS;
using
UIKit;
using
Xamarin.Forms;
[assembly: ExportRenderer(
typeof
(Telerik.XamarinForms.Input.RadCalendar),
typeof
(Telerik.XamarinForms.InputRenderer.iOS.CalendarRenderer))]
namespace
Test.iOS
{
[Register(
"AppDelegate"
)]
public
partial
class
AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
public
override
bool
FinishedLaunching(UIApplication app, NSDictionary options)
{
new
Telerik.XamarinForms.InputRenderer.iOS.CalendarRenderer();
global::Xamarin.Forms.Forms.Init();
TelerikForms.Init();
LoadApplication(
new
App());
return
base
.FinishedLaunching(app, options);
}
}
}
using
System;
using
Android.App;
using
Android.Content;
using
Android.Content.PM;
using
Android.Runtime;
using
Android.Views;
using
Android.Widget;
using
Android.OS;
using
Xamarin.Forms;
[assembly: ExportRenderer(
typeof
(Telerik.XamarinForms.Input.RadCalendar),
typeof
(Telerik.XamarinForms.InputRenderer.Android.CalendarRenderer))]
namespace
Test.Droid
{
[Activity(Label =
"Test.Droid"
, Icon =
"@drawable/icon"
, Theme =
"@style/MyTheme"
, MainLauncher =
true
, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public
class
MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected
override
void
OnCreate(Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base
.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(
this
, bundle);
LoadApplication(
new
App());
}
}
}
Nikolay Diyanov Diyanov is the Product Manager of the Native Mobile UI division at Progress. Delivering outstanding solutions that make developers' lives easier is his passion and the biggest reward in his work. In his spare time, Nikolay enjoys travelling around the world, hiking, sun-bathing and kite-surfing.
Find him on Twitter @n_diyanov or on LinkedIn.