- BlankMauser
- Posts: 1
- Joined:
Extending ComboBox
In WPF I can extend control templates (like ComboBox). However, when I try extending ComboBox in Noesis, even when I declare identical comboboxes (Which appear identical in Blend), the extended combobox in Unity is just completely broken:
Left is the extended combobox that has no code, just inherits from Noesis.Combobox. While right is the default one.
I'm guessing that this is just not the intended workflow for Noesis? If I want to extend combobox I should be creating my own control and inheriting from ItemClass and essentially re-doing a lot of the default functionality?
Left is the extended combobox that has no code, just inherits from Noesis.Combobox. While right is the default one.
I'm guessing that this is just not the intended workflow for Noesis? If I want to extend combobox I should be creating my own control and inheriting from ItemClass and essentially re-doing a lot of the default functionality?
-
sfernandez
Site Admin
- Posts: 3154
- Joined:
Re: Extending ComboBox
Hi, the magenta indicates that Noesis is using the internal default styles for your custom ComboBox. This means that you haven't defined a style for your custom control in the Application Resources. If you want to use the style+template defined in NoesisTheme for the ComboBox you can just extend that style:
Could you please try that?
Code: Select all
<Style TargetType="{x:Type local:CustomComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}"/>
-
sfernandez
Site Admin
- Posts: 3154
- Joined:
Re: Extending ComboBox
Just to clarify, did you include our NoesisTheme in the Blend project?I declare identical comboboxes (Which appear identical in Blend)
To do so you'll have to add a reference in the Blend project to our Noesis.GUI.Extensions NuGet and then add the following line to your App.xaml (Application Resources):
Code: Select all
<Application>
<Application.Resources>
<ResourceDictionary Source="pack://application:,,,/Noesis.GUI.Extensions;component/Theme/NoesisTheme.DarkBlue.xaml" />
</Application.Resources>
</Application>
When this is correctly setup and you add a ComboBox and a CustomComboBox to your window you should see that the CustomComboBox is not using the Noesis theme either, it just falls back to the operating system (internal) template.
Who is online
Users browsing this forum: No registered users and 3 guests