Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use FSCalendarDelegateAppearance? #13

Open
mohibsheth opened this issue Jul 28, 2017 · 2 comments
Open

How to use FSCalendarDelegateAppearance? #13

mohibsheth opened this issue Jul 28, 2017 · 2 comments

Comments

@mohibsheth
Copy link

Hi @MarcBruins ,

First of all, thank you very much for the binding. The control is awesome and it's very helpful to see a working binding for it.

We have started using this library in our app but we aren't able to figure out how to use the FSCalendarDelegateAppearance?

I can see the definition for it but don't see any way to provide it's implementation to the FSCalendar instance.

Do you know how?

Thanks

@singhal2
Copy link

singhal2 commented Jul 28, 2017 via email

@drunkendaddy
Copy link

Thanks singhal2.

Here's how I did it

public partial class ViewController : UIViewController
    {
   
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            calendar.WeakDelegate = this;
        }

        [Export("calendar:appearance:titleDefaultColorForDate:")]
        public UIColor TitleDefaultColorForDate(FSCalendar calendar, FSCalendarAppearance appearance, NSDate date)
        {
            DateTime dt1 = new DateTime(2018, 1, 6);
            DateTime dt2 = date.ToDateTime();

            if (dt1.Date == dt2.Date)
            {
                return UIColor.Black;
            }
            return UIColor.Gray;
        }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants