[Unity] Inheriting from classes other than UserControl
I need to implement a special tab-like control that works similar to the WinPhone tab-like control. For that I need two new controls, my own custom TabControl inherited from Selector and another one inherited from HeaderedContentControl.
Before I start trying to implement it in Noesis I just wanted to be sure that's possible to achieve with the current v1.2. I'm asking because it was always said that you can only inherit from UserControl, other FrameworkElements don't provide everything you would need.
Before I start trying to implement it in Noesis I just wanted to be sure that's possible to achieve with the current v1.2. I'm asking because it was always said that you can only inherit from UserControl, other FrameworkElements don't provide everything you would need.
Re: [Unity] Inheriting from classes other than UserControl
*sigh*
I started off writing this in WPF first. Due to the previously mentioned uncertainties I decided after a while to just use UserControls. That required a few more implementation details but in the end it works.
After that I tried to convert it to NoesisGUI but failed miserably as apparently it is not possible to register any kind of collection as a dependency property. First I thought it affects only generic types but I'm not even allowed to use the non-generic IEnumerable. Am I just doing something wrong or is this really not supported? *sigh*
I'll also file a bug report.
I started off writing this in WPF first. Due to the previously mentioned uncertainties I decided after a while to just use UserControls. That required a few more implementation details but in the end it works.
Code: Select all
<local:SwipeTabControlView Background="SlateGray" Margin="20">
<local:SwipeTabControlView.Tabs>
<local:SwipeTabItemView Header="Header 1">
<TextBlock Text="Content 1" />
</local:SwipeTabItemView>
<local:SwipeTabItemView Header="Header 2">
<TextBlock Text="Content 2" />
</local:SwipeTabItemView>
<local:SwipeTabItemView Header="Header 3">
<TextBlock Text="Content 3" />
</local:SwipeTabItemView>
</local:SwipeTabControlView>
After that I tried to convert it to NoesisGUI but failed miserably as apparently it is not possible to register any kind of collection as a dependency property. First I thought it affects only generic types but I'm not even allowed to use the non-generic IEnumerable. Am I just doing something wrong or is this really not supported? *sigh*
I'll also file a bug report.
Re: [Unity] Inheriting from classes other than UserControl
Okay, it looks like Noesis.Collection is the only type of collection that works. But I thought this one is going to be deprecated/removed in v1.2?
Edit: Okay, I give up for now. The old collection doesn't have a CollectionChanged event.
Edit: Okay, I give up for now. The old collection doesn't have a CollectionChanged event.
-
-
sfernandez
Site Admin
- Posts: 3264
- Joined:
Re: [Unity] Inheriting from classes other than UserControl
I answered these questions in the ticket you opened about the Collection property problem.
Re: [Unity] Inheriting from classes other than UserControl
Yes, you can inherit, although the functionality is quite limited right now. Basically you can extend any class adding new dependency properties and events but the expected virtual functions are yet not there (OnMouseMove, OnMouseEnter,...).I'm asking because it was always said that you can only inherit from UserControl, other FrameworkElements don't provide everything you would need.
If you have a list of virtual functions you are missing, please file a bug and we will try to have them as soon as possible.
Who is online
Users browsing this forum: No registered users and 0 guests