Foreground not passed down the tree?
I've just created a menu with a couple of menu items below it. On the menu tag itself I've set Foreground="Magenta" and I expected that all the menu items would then be displayed in magenta but they stay the way they were before.
I'm using the Noesis project template and that allows me to run the WPF application in parallel where all the items are magenta - as I would expect from WPF.
Am I doing something wrong?
Thanks in advance!
Günther
I'm using the Noesis project template and that allows me to run the WPF application in parallel where all the items are magenta - as I would expect from WPF.
Am I doing something wrong?
Thanks in advance!
Günther
Re: Foreground not passed down the tree?
I've just tried it with the free Noesis GUI 2.1 and there the Foreground property is correctly passed down the tree.
So this seems to have changed between Noesis 2 and 3, right?
So Noesis 3 is moving away from WPF standards?
Anyway, I'll stay with 2.1 then.
So this seems to have changed between Noesis 2 and 3, right?
So Noesis 3 is moving away from WPF standards?
Anyway, I'll stay with 2.1 then.
-
sfernandez
Site Admin
- Posts: 2995
- Joined:
Re: Foreground not passed down the tree?
Hi, we try not to deviate from WPF, so this is something we should change.
The foreground brush is specified in the style for the MenuItem in Noesis theme. It is strange because in Blend if you create a Menu with some menu items the Foreground is inherited from the Menu as you said. But if you select the MenuItem and click on "Format > Edit Style > Edit a Copy..." it creates a style that defines a setter for the Foreground property and it is not inheriting the foreground from the Menu anymore. We used those copies as references to create our theme styles.
Could you please report it in our bugtracker, we will fix it in a future release.
In the meantime you can override the style for the menu items like this:
The foreground brush is specified in the style for the MenuItem in Noesis theme. It is strange because in Blend if you create a Menu with some menu items the Foreground is inherited from the Menu as you said. But if you select the MenuItem and click on "Format > Edit Style > Edit a Copy..." it creates a style that defines a setter for the Foreground property and it is not inheriting the foreground from the Menu anymore. We used those copies as references to create our theme styles.
Could you please report it in our bugtracker, we will fix it in a future release.
In the meantime you can override the style for the menu items like this:
Code: Select all
<Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
<Setter Property="Foreground" Value="Magenta">
</Style>
Re: Foreground not passed down the tree?
This is related to the new theme added in 3.0. Thanks for reporting this, please, as mentioned above, open a ticket if needed.So Noesis 3 is moving away from WPF standards?
Re: Foreground not passed down the tree?
Thanks for your reply.
Bug created.
Bug created.
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests