Hello all,
we found that XamCheckEditor is the only editor control not taking over the assigned metro style when we use the advanced style assignment with the Style keyword:
<StackPanel> <igEditor:XamCheckEditor/> <igEditor:XamCheckEditor Theme="Metro"/> <igEditor:XamCheckEditor Style="{x:Static igThemes:EditorsMetro.XamCheckEditor}"/> <igEditor:XamTextEditor/> <igEditor:XamTextEditor Theme="Metro"/> <igEditor:XamTextEditor Style="{x:Static igThemes:EditorsMetro.XamTextEditor}"/> <igEditor:XamNumericEditor/> <igEditor:XamNumericEditor Theme="Metro"/> <igEditor:XamNumericEditor Style="{x:Static igThemes:EditorsMetro.XamNumericEditor}"/> <igEditor:XamComboEditor/> <igEditor:XamComboEditor Theme="Metro"/> <igEditor:XamComboEditor Style="{x:Static igThemes:EditorsMetro.XamComboEditor}"/> </StackPanel>
Plus you can see small differences also with the other editors. Is there a way to
We are also aware of the following blog post, which helped us actually to understand how to combine styles: Blog - but why is this not working for XamCheckEditor?
BR Florian
Hi Florian,
I have received a reply from our development team and when the ‘Style’ property is used in order to apply a theme, the theme is not applied for any of the control completely. This is by design because the control is referring to a style for the theme, but this way the dynamic resources used in this style are not loaded. This is why the theme cannot be completely applied. This issue can be recognized in the other editors too. For example, you can open and close the second and third XamComboEditors and you will see the difference in their appearance. My suggestion is to use the ‘Theme’ property which purpose is to apply a theme on the controls.
Let me know, if you need any further assistance on this matter.
Dear Yanko,
please tell them to look at the blog entry I have linked and then they should tell us how to achieve Scenario 2:
<QUOTE>
Another case where this occurs is if you explicitly or implicitly set the Style of an element. Recall that when WPF is locating the local style, it will first check the Style Property. If that is set then that will be the local style and it will not attempt to look for an implicit style. Since the implicit style will not be used, the Style provided for the element from the Theme will not be used. One way to workaround this is to set the Based on of your Style to the Style for the Theme you are using.
</QUOTE>
Because this is exactly our case: we want to use Theme on the control + we want to use some certain style which will override just some validation properties. I marked the important part in bold. We need to use BasedOn already, so we defined the following:
<Style x:Key="XamTextEditorMetro" TargetType="{x:Type igWPF:XamTextEditor}" BasedOn="{x:Static igThemes:EditorsMetro.XamTextEditor}"/>
Still it leads to the result that not all styling is applied.
So I would summarize:
- If we need to make changes to the style for example for validating the input, we cannot use Themes anymore
- The blog article needs to be revised, since using "BasedOn" is not leading to equal results and therefore is no valid workaround
Is it really like this? We dont want to mess with the visual part of the theme, just add validation style elements. Would be really nice to have this... Maybe also Andrew can bring light on this issue.