Sybaris
Topic Author
Posts: 39
Joined: 21 Feb 2019, 10:13

Foreground not passed down the tree?

22 Mar 2021, 20:34

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
 
Sybaris
Topic Author
Posts: 39
Joined: 21 Feb 2019, 10:13

Re: Foreground not passed down the tree?

22 Mar 2021, 20:48

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.
 
User avatar
sfernandez
Site Admin
Posts: 2995
Joined: 22 Dec 2011, 19:20

Re: Foreground not passed down the tree?

23 Mar 2021, 11:38

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:
<Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
  <Setter Property="Foreground" Value="Magenta">
</Style>
 
User avatar
jsantos
Site Admin
Posts: 3919
Joined: 20 Jan 2012, 17:18
Contact:

Re: Foreground not passed down the tree?

24 Mar 2021, 01:58

So Noesis 3 is moving away from WPF standards?
This is related to the new theme added in 3.0. Thanks for reporting this, please, as mentioned above, open a ticket if needed.
 
Sybaris
Topic Author
Posts: 39
Joined: 21 Feb 2019, 10:13

Re: Foreground not passed down the tree?

24 Mar 2021, 10:21

Thanks for your reply.
Bug created.

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests