How to use ContentPage with UIViewController - VisualStudio IOS

123 views Asked by At

Is there a way to use the ContentPage in a UIViewController?

I'm using SyncFusion SfCalendar that inherits View and i want to show the callendar in my view controller.

    SfCalendar _calendar;
    public CalendarTest(IntPtr handle) : base(handle)
    {
    }

    public override void ViewDidLoad()
    {
        _calendar = new SfCalendar();
        _calendar.OnDateCellHolding += DateCellClicked;

        base.ViewDidLoad();
    }
1

There are 1 answers

0
Rathanakumar On BEST ANSWER

I have attached the code sample, which added the SFCalendar to ViewController view.

    public override void ViewDidLoad()
    {
        SFCalendar calendar = new SFCalendar();
        base.ViewDidLoad();
        calendar.Frame = new CGRect(0, 0, View.Frame.Width, View.Frame.Height);
        SFMonthViewSettings month = new SFMonthViewSettings();
        month.BorderColor = UIColor.Red;
        calendar.MonthViewSettings = month;
        View.AddSubview(calendar);

    }