Comments (9)
I ended up figuring a workaround. I wrapped the SideNav using a ColorZone. Hope it helps others!
from materialdesignextensions.
Actually I'm going to re-open this issue for visibility for a real fix.
This workaround is only for color zones of Light (lesser of 2 evils but also unusable for bright primaries like yellow and lime) and PrimaryLight (barely usable) . All other combinations are unusable.
from materialdesignextensions.
@dicksonpun As I understand your posts, you need other colors for the text and highlight border to get more contrast. Try to set the SelectionForeground
, SelectionBackground
and NavigationItemFeedback
properties of the SideNavigation
.
Please let me know if this solves your issue.
from materialdesignextensions.
Thanks for the prompt response. This partially addresses my issue. It helps address the colors regarding the selected item. The part I'm still having a roadblock on is how to set the unselected/unselectable items like unselected FirstLevelNavigationItems and SubheaderNavigationItems. Any ideas?
from materialdesignextensions.
@dicksonpun The SideNavigation
looks fine in the demo app. The templates use dynamic resources as the foreground, which will be set inside the specific theme resource dictionary.
I think that something in your app setup or control styles messes up the text block foreground. You might have a conflicting style definition in your app. Do you have an own definition for MaterialDesignNavigationItemSubheader
or MaterialDesignNavigationItemText
? Do you use the predefined classes for the items or do you use any custom classes implementing the necessary interface?
If you do not find any problems on your own, could you please attach a sample project with the reproduced behavior? I can do a much better analysis with the full source code.
from materialdesignextensions.
I think that something in your app setup or control styles messes up the text block foreground. You might have a conflicting style definition in your app.
Ahh I think that sounds very plausible.
I was referencing this github project (Bachup) for the style and themes in my learning demo project. I wonder if the way this project implemented the style conflicts/overrides the predefined settings.
I've since switched to using the ColorTool example in the MaterialDesignInXamlToolkit for in my non-learning project (not public on Github unfortunately). I haven't had a chance to experiment with the SideNavigation with the ColorTool in that project yet.
Not-related but kinda, something I did notice was that the dark modes seem different between these Demos and I'm not sure why:
If you don't mind taking a quick look see if anything sticks out to you in my demo project, I'd appreciate it. Please let me know if I goofed up the settings, I'd be interested in learning what I did wrong. Thanks!
from materialdesignextensions.
@dicksonpun The dark modes look different because of a different brush for the background. Material Design Extensions uses Background="{DynamicResource MaterialDesignBackground}"
while Material Design in XAML uses Background="{DynamicResource MaterialDesignPaper}"
instead. Both projects define the background in their MainWindows.xaml
.
I was very busy the last two weeks. I hope that I can have a deeper look into your demo project this week.
from materialdesignextensions.
- Your configuration seems to be fine.
- I would remove the
ColorZone
from inside the drawer, because it is a temporary hack solution. - If you are having problems with colors, it is usually an issue with conflicting resources. Just try to add the desired theme resources into the problematic control's resources. See StepperControl.xaml line 102 of the demo for an example.
from materialdesignextensions.
Thank you for looking at this issue. Your recent comments helped point me in the right direction.
I ended up figuring out how to properly resolve this issue, in case you were interested.
App.xaml
As it turns out I did not include the DarkTheme counterpart in the MergedDictionary section. Even when I did, (you may already know this) it appears as though the ResourceDictionary is loaded in sequential order such that it favors the last loaded item.
CASE 1 (DarkTheme is loaded first, followed by LightTheme)
As you can see the LightTheme looks great, and the DarkTheme not so much.
CASE 2 (LightTheme is loaded first, followed by DarkTheme)
As you'd expect the observed pattern is consistent here.
SOLUTION!
App.xaml
Only add either the LightTheme or DarkTheme ResourceDictionary.
<Whatever file/function is handling the Theme switch event>
Add logic to update the ResourceDictionary before setting the Theme. Someone smarter than me can probably optimize it but for now... it works!
from materialdesignextensions.
Related Issues (20)
- Weird flickering on Windows 11 when using MaterialWindow
- Hide close button ToolWindow
- Wrong Foreground style set for FlatButton
- How to include a PopupBox in MaterialWindow TitleTemplate
- Bug: Commands trigger only once in Stepper.
- Graphic Bug with MaterialWindow : Apply ToolWindow style and SizeToContent HOT 1
- Impossible to change Language of NavigationItems during runtime
- Foreground of the Textblocks inside the TabControl does not change when the theme is set to dark mode. HOT 2
- build errors: xml does not exist in namespace
- No refresh when the same viewModel is used in a List<INavigationItem>
- SideNavigation Style Scrollbar ?
- OpenFileDialog not gone when hitting a breakpoint in visual studio HOT 1
- MaterialDesignExtensions 3.3.0 has a resource with the locale 'Ru' HOT 2
- Stepper Controller Bug: Navigating to Initial (First) Step in Code Goes to Second Step Instead HOT 1
- It is recommended that you add functionality to the file system control
- MaterialDesignThemes.WPF 5.0.0 HOT 2
- MaterialDesignStepNumberIconTemplate not found HOT 1
- Chaning the MaterialWindow Title bar color HOT 1
- Title Icon size of 16x16 HOT 1
- Is the project dead? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from materialdesignextensions.