Forum Xamarin.iOS

Custom Class Outlet

Hey There...

I'm currently developing an app in which I want to use a custom button. As I understand, if I switch to XCode and back, Xamarin Studio updates the designer files for the XIB files. Now if I'm developing a custom button control (for design and response purposes) and want to set it in the designer, I can use the CustomClass property of the XIB. Now when I do that and then add the outlet to the .h file, it's primary response is to argue about a non existing type (let's call it CustomButton).

Custom Button:
[Register("DashboardIconButton")] public class DashboardIconButton : UIButton { public DashboardIconButton () { //...// } }

After that, when the references and designer files are updated, I see an outlet

[Outlet] MonoFoundation.......NSObject MyButtonOutletName{get;set;}

Now my question is, why does the designer not use the type I want? If I manually add "DashboardIconButton" instead of NSObject, it works like a charm, but I don't want to do that for all the outlets that uses custom UI controlls.



  • ChristophBhlerChristophBhler USMember

    Well.. after some restarting of XCode and Xamarin Studio it recognized the class...

    nevermind :)

Sign In or Register to comment.