Comments (2)
I see this is kind of misleading, sorry for that. The ResourceAliasExtension
should be either public
or the docs should be more clear about how to create custom color schemes.
I'll try to explain it a little more detailed here.
If you want to create a whole new color scheme you can create a new ResourceDictionary file and add a new Color
for each key in AdonisUI.Colors
and a new Brush
(e.g. SolidColorBrush
) for each key in AdonisUI.Brushes
. Don't forget to use AdonisUI's keys for all those resources, e.g.:
<Color x:Key="{x:Static adonisUi:Colors.AccentColor}">#0BAC08</Color>
<!-- all colors go here -->
<SolidColorBrush x:Key="{x:Static adonisUi:Brushes.AccentBrush}" Color="{DynamicResource {x:Static adonisUi:Colors.AccentColor}}"/>
<!-- all brushes go here -->
If you want to use a shipped color scheme and customize only some resources you can create a new ResourceDictionary file and make it include the theme you want to derive from in its ResourceDictionary.MergedDictionaries
. Afterwards, you can create colors as you like and assign the color keys you want to override.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AdonisUITest"
xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/AdonisUI;component/ColorSchemes/Light.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Color x:Key="{x:Static adonisUi:Colors.AccentColor}">Green</Color>
<!-- additional colors or brushes go here -->
</ResourceDictionary>
The colors and brushes you did not specify are then taken from the included color scheme. You can include this ResourceDictionary in your App.xaml
instead of the light and dark color schemes or in addition to them if you want to switch between those.
So now regarding your question: The ResourceAliasExtension
is only used for Layer0BorderColor
(and the associated brush). You can now either leave this color as it is by including the light color scheme and simply not overriding it. Or you assign a new value to it like mentioned:
<Color x:Key="{x:Static adonisUi:Colors.Layer0BorderColor}">#404040</Color>
Hope this helps :)
from adonis-ui.
Yes that does help, thanks!
I didn't think to use the Adonis Light.xaml as a MergedDictionary inside my own ColorScheme. That's much better than copying the whole thing.
from adonis-ui.
Related Issues (20)
- Ribbon control
- RippleHost causing MemoryLeaks HOT 1
- About the select page
- Change accent color at runtime
- center window don't work HOT 1
- MessageBox result closes application HOT 3
- Remove red border around button content when using data validation HOT 4
- AdonisWindow // Hide all buttons property
- Text wrapping for watermark
- AdonisWindow not getting garbage collected HOT 2
- Adonis UI alternative for Avalonia? HOT 1
- Questions HOT 2
- Extend style of control styled with Classic Theme? (.NET 7) HOT 1
- Setting ResizeMode "CanResizeWithGrip" on the window removes Adonis title bar
- Resource not found; ResourceKey='TargetType=AdonisUI.Brushes ID=Layer0BorderBrush'
- visual studio 2022 xaml designer not showing adonisControls:AdonisWindow HOT 2
- Cannot add AdonisUI Custom Components from Toolbox or it's not seen xaml code?
- Add Expander control style HOT 1
- [Support request] AdonisUI styling not applying to codebehind-generated control? HOT 1
- Memory leak to AdonisWindow from HandleTitleBarActualHeightChanged
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 adonis-ui.