Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Calendar Crashing in iOS

$
0
0

Telerik version: 2015.3.1016
Xamarin Version: 1.5.0.6447

 

Here's the code.  Just put in App.css and run

using System;
using Telerik.XamarinForms.Input;
using Telerik.XamarinForms.Common;
using Xamarin.Forms;
namespace CalendarDemo
{
public class App : Application
{
public static MainPage _MasterDetailPage { get; set; }
public static NavigationPage _NavPage { get; set; }
public App()
{
_NavPage = new NavigationPage();
// The root page of your application
MainPage = new MainPage();
}
}
public class MainPage : MasterDetailPage
{
ContentPage menuPage;
public MainPage()
{
App._MasterDetailPage = this;
menuPage = new ContentPage { Icon = "menu.png", Title = "Menu" };
Master = menuPage;
NavigateToPage((Page)Activator.CreateInstance(typeof(FirstPage)));
}
public async void NavigateToPage(Page targetPage = null)
{
if (targetPage != null)
{
await App._NavPage.PushAsync(targetPage);
Detail = App._NavPage;
IsPresented = false;
}
}
}
public class FirstPage : ContentPage
{
public FirstPage()
{
var layout = new StackLayout();
var button = new Button
{
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
Text = "Press for Calendar",
};
button.Clicked += Button_Clicked;
layout.VerticalOptions = LayoutOptions.CenterAndExpand;
layout.HorizontalOptions = LayoutOptions.CenterAndExpand;
layout.Children.Add(button);
Content = layout;
}
private void Button_Clicked(object sender, EventArgs e)
{
App._MasterDetailPage.NavigateToPage((Page)Activator.CreateInstance(typeof(CalendarPage)));
}
}
public class CalendarPage : ContentPage
{
private static DateTime _DefaultDateTime = new DateTime(2000, 1, 1);
public CalendarPage()
{
RadCalendar radCalendar = new RadCalendar();
radCalendar.SelectedDate = _DefaultDateTime;
radCalendar.SelectionChanged +=
(object sender, ValueChangedEventArgs<object> e) =>
{
DateTime? selectedDate = e.NewValue as DateTime?;
radCalendar.SelectedDate = _DefaultDateTime;
App._MasterDetailPage.NavigateToPage((Page)Activator.CreateInstance(typeof(DateDetailPage), selectedDate));
};
Content = radCalendar;
}
}
public class DateDetailPage : ContentPage
{
public DateDetailPage(DateTime? dateTime)
{
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Children = {
new Label {
XAlign = TextAlignment.Center,
Text = "Welcome to DateDetailPage!!!"
}
}
};
}
}
}


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>