1

I am not in Xamarin.Forms. In windows desktop apps (win forms and wpf), you can create a user UI component and you can use it in any project. Is it possible to create that kind of small UI elments in Xamarin.Forms?

I will have like a dll and will add to my project and will add to my form and I will give properties that I'll already defined in the UI element.

ertan2002
  • 1,458
  • 1
  • 32
  • 68
  • Yes you can do that in xamarin forms aswell – FreakyAli Oct 17 '18 at 10:47
  • @G.hakim thank you for the reply. Is there any example that I can see? Because I search and did not find that kind of stuff. Mostly they were about dynamic UI element creationg – ertan2002 Oct 17 '18 at 11:11
  • 1
    Xamarin forms controls are typically created through ContentView - some examples : https://mindofai.github.io/Creating-Custom-Controls-with-Bindable-Properties-in-Xamarin.Forms/ and yes you can separate them out in another project to get a dll to reference – Depechie Oct 17 '18 at 11:52
  • 1
    Well, you already got the answer above so I would suggest you follow that in case of queries revert. – FreakyAli Oct 17 '18 at 12:18
  • 1
    Thank you all. @Depechie, if you write it as answer, I will accept as answer. The documentation seems very useful. – ertan2002 Oct 17 '18 at 13:26

1 Answers1

3

So, in Xamarin Forms world, we typically create User Controls through use of ContentView.

This can be done with a XAML part and code behind, but you can easily create them just in code too. There are a series of tutorials available on the web, one that is very clear is this one https://mindofai.github.io/Creating-Custom-Controls-with-Bindable-Properties-in-Xamarin.Forms/

If needed, you can create a separate Xamarin Forms project that encapsulates your controls and reference that in your main app solution.

Depechie
  • 6,102
  • 24
  • 46