benruehl / adonis-ui Goto Github PK
View Code? Open in Web Editor NEWLightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
Home Page: https://benruehl.github.io/adonis-ui/
License: MIT License
Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
Home Page: https://benruehl.github.io/adonis-ui/
License: MIT License
Hey,
i did a quick research for the problem i mentioned in my other issue #17 and found that a more valid solution would be to find the controls parent window in the wpf visual tree.
You can easily cache the parent window for further lookups in case it is needed after initialization.
I also dont think that this takes to much time to look up even using a recursive approach.
MahApps.Metro implements the search logic like this and i always found those extension methods pretty helpful when using the metro framework.
https://github.com/MahApps/MahApps.Metro/blob/develop/src/MahApps.Metro/Controls/TreeHelper.cs#L24
This may also be useful to be included in this project in my opinion.
What do you think?
Describe the bug
The SpaceExtension causes error
'' is not a valid value for the 'System.Windows.Controls.Control.Padding' property on a Setter.
and make the WPF designer stopped working.
It's just randomly appear in designer. like this.
Additional context
I've resolved some of error this by adding this piece of code in App.xaml.cs
:
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
AdonisUI.SpaceExtension.SetSpace(8, 8);
}
but still, it's not the solution right?
Is there any Fallback value for the SpaceExtension
if something's not right?
I would like the titlebar to have the style applied to it as well. It looks a little bit out of place when using the dark theme and having the white titlebar. I was thinking along the lines of how ModernUI did their titlebar.
Currently, when we try to put TabStripPlacement="Left", the result is very off.
It would be awesome if Adonis could handle other TabStripPlacement than "Top".
We currently have put a patch in place in our project to detect the TabStripPlacement. Here is the bit of code that we have put in place:
<Style
x:Key="{x:Type TabControl}"
BasedOn="{StaticResource {x:Type TabControl}}"
TargetType="TabControl">
<Style.Triggers>
<Trigger Property="TabStripPlacement" Value="Left">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TabPanel
x:Name="HeaderPanel"
Grid.Column="0"
Panel.ZIndex="1"
Background="Transparent"
IsItemsHost="True"
KeyboardNavigation.TabIndex="1" />
<Border
x:Name="Border"
Grid.Column="1"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
KeyboardNavigation.DirectionalNavigation="Contained"
KeyboardNavigation.TabIndex="2"
KeyboardNavigation.TabNavigation="Local">
<Border.CornerRadius>
<MultiBinding Converter="{x:Static adonisConverters:ValuesToCornerRadiusConverter.Instance}">
<Binding Source="0" />
<Binding Path="(adonisExtensions:CornerRadiusExtension.CornerRadius).TopRight" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="(adonisExtensions:CornerRadiusExtension.CornerRadius).BottomRight" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="(adonisExtensions:CornerRadiusExtension.CornerRadius).BottomLeft" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</Border.CornerRadius>
<ContentPresenter
x:Name="PART_SelectedContentHost"
Margin="{adonisUi:Space 1,
1,
1,
1}"
ContentSource="SelectedContent" />
</Border>
<Border
x:Name="SelectedItemHighlight"
Grid.Column="1"
Width="4"
Margin="{TemplateBinding BorderThickness}"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Background="{DynamicResource {x:Static adonisUi:Brushes.Layer1HighlightBrush}}">
<Border.CornerRadius>
<MultiBinding Converter="{x:Static adonisConverters:ValuesToCornerRadiusConverter.Instance}">
<Binding Source="0" />
<Binding Path="(adonisExtensions:CornerRadiusExtension.CornerRadius).TopRight" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Source="0" />
<Binding Source="0" />
</MultiBinding>
</Border.CornerRadius>
</Border>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding Path=(adonisExtensions:LayerExtension.ComputedLayer), RelativeSource={RelativeSource Self}}" Value="2">
<Setter TargetName="SelectedItemHighlight" Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer2HighlightBrush}}" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=(adonisExtensions:LayerExtension.ComputedLayer), RelativeSource={RelativeSource Self}}" Value="3">
<Setter TargetName="SelectedItemHighlight" Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer3HighlightBrush}}" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=(adonisExtensions:LayerExtension.ComputedLayer), RelativeSource={RelativeSource Self}}" Value="4">
<Setter TargetName="SelectedItemHighlight" Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer4HighlightBrush}}" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<Style
x:Key="{x:Type TabItem}"
BasedOn="{StaticResource {x:Type TabItem}}"
TargetType="TabItem">
<Setter Property="Padding" Value="8" />
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type TabControl}}, Path=TabStripPlacement}" Value="Left">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Grid x:Name="OuterGrid" Height="30">
<Border
x:Name="Border"
Padding="4"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}">
<Border.BorderThickness>
<MultiBinding Converter="{x:Static adonisConverters:ValuesToThicknessConverter.Instance}">
<Binding Path="BorderThickness.Left" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="BorderThickness.Top" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Source="0" />
<Binding Path="BorderThickness.Bottom" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</Border.BorderThickness>
<Border.CornerRadius>
<MultiBinding Converter="{x:Static adonisConverters:ValuesToCornerRadiusConverter.Instance}">
<Binding Path="(adonisExtensions:CornerRadiusExtension.CornerRadius).TopLeft" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Source="0" />
<Binding Path="(adonisExtensions:CornerRadiusExtension.CornerRadius).BottomLeft" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Source="0" />
</MultiBinding>
</Border.CornerRadius>
</Border>
<Border
x:Name="SpotlightLayer"
adonisExtensions:CursorSpotlightExtension.MouseEventSource="{Binding RelativeSource={RelativeSource TemplatedParent}}"
Background="{TemplateBinding adonisExtensions:CursorSpotlightExtension.BackgroundBrush}"
BorderBrush="{TemplateBinding adonisExtensions:CursorSpotlightExtension.BorderBrush}">
<Border.BorderThickness>
<MultiBinding Converter="{x:Static adonisConverters:ValuesToThicknessConverter.Instance}">
<Binding Path="BorderThickness.Left" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="BorderThickness.Top" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Source="0" />
<Binding Path="BorderThickness.Bottom" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</Border.BorderThickness>
<Border.CornerRadius>
<MultiBinding Converter="{x:Static adonisConverters:ValuesToCornerRadiusConverter.Instance}">
<Binding Path="(adonisExtensions:CornerRadiusExtension.CornerRadius).TopLeft" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Source="0" />
<Binding Path="(adonisExtensions:CornerRadiusExtension.CornerRadius).BottomLeft" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Source="0" />
</MultiBinding>
</Border.CornerRadius>
</Border>
<Grid Name="TabPanel" Background="Transparent">
<ContentPresenter
x:Name="ContentSite"
Margin="8,4"
HorizontalAlignment="Center"
VerticalAlignment="Center"
ContentSource="Header"
RecognizesAccessKey="True" />
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="OuterGrid" Property="Margin" Value="0,0,-1,0" />
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter TargetName="OuterGrid" Property="Margin" Value="4,0,0,0" />
</Trigger>
<Trigger SourceName="TabPanel" Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer1HighlightBrush}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer1HighlightBorderBrush}}" />
<Setter Property="adonisExtensions:CursorSpotlightExtension.BackgroundBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer1IntenseHighlightBrush}}" />
<Setter Property="adonisExtensions:CursorSpotlightExtension.BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer1IntenseHighlightBorderBrush}}" />
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=(adonisExtensions:LayerExtension.ComputedLayer), RelativeSource={RelativeSource Self}}" Value="2" />
<Condition Binding="{Binding IsMouseOver, ElementName=TabPanel}" Value="True" />
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer2HighlightBrush}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer2HighlightBorderBrush}}" />
<Setter Property="adonisExtensions:CursorSpotlightExtension.BackgroundBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer2IntenseHighlightBrush}}" />
<Setter Property="adonisExtensions:CursorSpotlightExtension.BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer2IntenseHighlightBorderBrush}}" />
</MultiDataTrigger.Setters>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=(adonisExtensions:LayerExtension.ComputedLayer), RelativeSource={RelativeSource Self}}" Value="3" />
<Condition Binding="{Binding IsMouseOver, ElementName=TabPanel}" Value="True" />
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer3HighlightBrush}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer3HighlightBorderBrush}}" />
<Setter Property="adonisExtensions:CursorSpotlightExtension.BackgroundBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer3IntenseHighlightBrush}}" />
<Setter Property="adonisExtensions:CursorSpotlightExtension.BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer3IntenseHighlightBorderBrush}}" />
</MultiDataTrigger.Setters>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=(adonisExtensions:LayerExtension.ComputedLayer), RelativeSource={RelativeSource Self}}" Value="4" />
<Condition Binding="{Binding IsMouseOver, ElementName=TabPanel}" Value="True" />
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer4HighlightBrush}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer4HighlightBorderBrush}}" />
<Setter Property="adonisExtensions:CursorSpotlightExtension.BackgroundBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer4IntenseHighlightBrush}}" />
<Setter Property="adonisExtensions:CursorSpotlightExtension.BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer4IntenseHighlightBorderBrush}}" />
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
Describe the bug
when windows is maximized the title bar height shrink into 21pixels, even if it's normal behavior. consider adding option to keep the height. i. e. when merging menu with the titlebar
To Reproduce
Easiest step is opening adonisUI demo:
Expected behavior
this is the visual studio code behavior
Screenshots
This is the adonisUI.demo behavior
Additional context
none
Describe the bug
Seems like the ListViewItem style is causing some issues with the rendering of the listview item content. The text is not visible at all
To Reproduce
In my test project I boiled the issue down to the ListViewItem style
https://github.com/Swiftpaws/Adonis-ListViewBug
Describe the bug
Once Adonis is used, MenuItem' hotkeys are not respected (they should be), and the underscore is displayed (it should not be)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The same behavior as vanilla WPF.
Describe the bug
When creating DataTemplate ListBox Item with binding, weird things happened with the hover state.
it shows default data binding
To Reproduce
Steps to reproduce the behavior:
Expected behavior
it supposed to show nothing but the content.
Screenshots
If you had a docs page called something like "Tips & tricks" or "Gotcha's", you could add this issue that I came across. I'm not sure why it used to work (before using Adonis styles) - probably because something used to have a background but now doesn't.
Symptom: Scrollviewer doesn't scroll with mousewheel after applying Adonis styles
Possible cause: If you have a control inside a scrollviewer, and the control has a PreviewMouseDown event handler, you may need to add some code to the scrollviewer. See this Stack Overflow answer for details.
(or - feel free to close this issue, at least someone searching for it might find the answer here.)
Setting HorizontalContentAlignment
has no effect when the style is active. Adding an empty style like the following fixes the problem, so its definitely caused by the custom style:
<ComboBox ItemsSource="{Binding ComboBoxItems}"
HorizontalContentAlignment="Stretch">
<!-- this removes the style but fixes the problem -->
<ComboBox.Style>
<Style>
</Style>
</ComboBox.Style>
<ComboBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Text on the left edge -->
<TextBlock Grid.Column="0"
Text="Left edge"/>
<!-- Text on the right edge -->
<TextBlock Grid.Column="3"
Text="Right edge"/>
</Grid>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
I encounterd a missing styling in the ScrollView that is inside a TextBox.
The corner rectangle in the bottom right that fills the space for both the vertical and horizontal scrollbar is tinted white in dark mode:
There sort of is a workaround as it is possible to override this style with the following code:
<TextBox>
<TextBox.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{DynamicResource {x:Static adonisUi:Colors.Layer2BackgroundColor}}"/>
</TextBox.Resources>
</TextBox>
But unfortunatley this overridden color does not match the background gradient of the TextBox that is present for the first 100 pixels or so.
(The color difference might be hard to notice in the images)
Disabled controls change their foreground to a different color which does not apply any difference to enabled controls in case there is no content in a control. For example, a disabled TextBox without text in it looks exactly the same as an enabled TextBox.
In addition to changing the foreground, further differences should be introduced like changing the border or background color.
Describe the bug
A Cannot find Dimensions.HorizontalSpace resource. Error occur when adding Adonis to project,
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The Program Run normally but the error is annoying.
Additional context
Run using VS 2019 (16.1 Preview 3)
Describe the bug
After reading the documentation, I set out to try and integrate the MessageBox
with my application. However I could not find it anywhere in the nuget package. AdonisUI.Controls.MessageBox.Show
is nowhere to be found.
To Reproduce
Steps to reproduce the behavior:
MessageBox.Show
using AdonisUI.Controls;
Expected behavior
The program compiles and a message box will be shown
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
I'm running on .NET Core 3.1.
Describe the bug
The Ripple layer in RippleHost appears to be leaking memory through it's event handlers. I am using it with a customized version of Extended WPF Toolkit and my busy hosts are not being freed from memory, and after using dotMemory, RippleHost is holding references to the control even though the control was already disposed.
To Reproduce
While I do not have a fully reproducible sample on hand, I think I have found the issue (or at least, what causes the initial event handler to be set that is not unset.
Expected behavior
The ripple layer should remove it's event handlers when the host is disposed. I am not entirely sure where this is performed.
Screenshots
In RippleHost.cs, when I commented out the lines setting the ParentWindowOnDeactivated and PreviewMouseLeftButtonUp, my objects were properly garbage collected.
I have a memory analyzer I build into my apps to help identify things not being freed (before I take it to dotMemory), and after commenting it out, I can see things being garbage collected (in this pic it was automatic - I didn't even clear it yet):
I made a video to demonstrate the issue, where memory is not freed/is freed before and after commenting out the addition of the handlers.
I don't think this is exclusive to Extended WPF Toolkit, it's just what I am using. A busy host is essentially an user control that appears in an overlay.
Additional context
The repo in question is https://github.com/me3tweaks/me3tweaksmodmanager. I have your library in there (slightly customized colors and a few other things like fixing the listbox ripple). In order to bring up this dialog you would need a mod (and a mass effect game) so I am not sure it is something you can easily do.
(thanks for your work on this excellent library!)
Describe the bug
"Custom color schemes" documentation recommends creating a copy of Light.xaml and/or Dark.xaml to customize. However, Light.xaml uses AdonisUI.Helpers.ResourceAliasExtension is internal, so I can't reference it from outside the AdonisUI dll. This means I effectively can't have a customised copy of Light.xaml in my own app.
To Reproduce
Steps to reproduce the behavior:
Additional context
Workaround is to create a copy of AdonisUI/Helpers/ResourceAliasExtension.cs in my own project - but would be nicer not to have to (i.e. if ResourceAliasExtension was a public class).
Is your feature request related to a problem? Please describe.
I would like to increase the animation duration for expanders and other controls but because the duration is hardcoded in the control template I would have to reimplement the template in order to change it.
Describe the solution you'd like
Similar to how radius and border thickness has a configurable variables, and additional one for animation duration seems that it would be a decent fit.
Describe alternatives you've considered
Reimplementing control templates which is cumbersome and would require maintenance as this library is improved over time.
Describe the bug
The code compiles and when AdonisUI.Demo is run the main windows doesn't inherit from Adonis and falls back to default WPF Window. Editing the MainWindow.xaml throws
Severity Code Description Project File Line Suppression State Error 'SpaceExtension' is not valid for Setter.Value. The only supported MarkupExtension types are DynamicResourceExtension and BindingBase or derived types.
AdonisUI.Demo MainWindow.xaml
To Reproduce
Steps to reproduce the behavior:
Expected behavior
MainWindow inherits the Adonis-UI theme.
Additional context
dotnet --version
2.2.203 Windows 7 x64
Using .NET Framework 4.6.1
and I have installed AdonisUI
and AdonisUI.ClassicTheme
latest versions via NuGet and they are referenced correctly in the project.
App.xaml
<Application x:Class="ExampleApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI"
xmlns:local="clr-namespace:ExampleApp"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="{x:Static adonisUi:ResourceLocator.DarkColorScheme}" />
<ResourceDictionary Source="{x:Static adonisUi:ResourceLocator.ClassicTheme}" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
MainWindow.xaml
<Window x:Class="ExampleApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ExampleApp"
mc:Ignorable="d"
Title="MainWindow"
Height="450"
Width="800">
<Window.Style>
<Style TargetType="Window"
BasedOn="{StaticResource {x:Type Window}}" />
</Window.Style>
<Grid>
<StackPanel Margin="10">
<Button Content="Click Me"
HorizontalAlignment="Center" />
</StackPanel>
</Grid>
</Window>
Issues:
<ResourceDictionary Source="{x:Static adonisUi:ResourceLocator.DarkColorScheme}" />
<ResourceDictionary Source="{x:Static adonisUi:ResourceLocator.ClassicTheme}" />
Both lines in App.xaml
are getting the following error:
Value cannot be null. Parameter name: item
.
I have tried multiple fresh projects, building and rebuilding and I keep getting this error. I am able to build the project and I can see the styles (DarkColorScheme) correctly applied on MainWindow
.
However the styles don't appear on the designer window, I'm not sure if it's related to the error I'm getting or not.
Any ideas what could cause this?
When I tried to close the program, it was found that it was not closed normally but was stuck in a math method of adonis. What needs to be explained is that I did not find similar problems in the .netframework environment, but in wpf of .netcore3.1 This problem will occur next, can you give me more information about the method when the program is closed so that I can try to solve it, thank you
I have a question about how to style a DataGrid control.
As of today i've been working with AdonisUI for several days. I started out knowing very little about WPF and have had an immense help from the demo project as well as the example projects from Microsoft.
Currently i'm working on an application that shows a lot of data which must also be editable (date fields must be set, text fields must be filled in, checkboxes ticked, etc). The obvious choice was to display all information inside a DataGrid control.
The demo project shows a GridView control that's automatically styled, but this doesn't happen automatically for the DataGrid control.
I suppose this is for a certain reason, but does that make correctly styling a DataGrid control a hard problem? If possible, i'd like some pointers on how to approach manually styling this control and/or example code (if that's laying around somewhere).
When i have this figured out i can contribute it back to the project ofcourse.
Thanks in advance!
EDIT; Almost all search results for (Data)Grid turn up the GridView from ListView. Am I not aware of some general consensus that DataGrid should not be used? I feel like DataGrid is such an easy control for quickly getting started that it's strange i can find little advanced usage about it.
A default style for the TabControl is required to support Adonis' color schemes in tab views.
I don't know if it's possible to disable the ripple and/or animation Programmatically. If it is, then it should be included in the documentation.
If it isn't, maybe this will be a feature request. Because application sometimes have too many progress bar, and the effect slows down the whole app
Quick and dirty fix is to add a null check, but it seems to make sense if that header wasn't there, or wasn't selectable.
A default style for the TreeView control is required to support Adonis' color schemes in tree views.
The thumb on the scrollbar currently has no min height/width set so it becomes very small once many items have been added.
Setting a min height/width should help - also I think increasing the width of the thumb itself should be natively possible.
If you want to save space between listbox items (not have white space inbetween items) but also want to have the border on mouseover:
<Style BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="ListBoxItem"> <Setter Property="MinHeight" Value="0" /> <Setter Property="BorderThickness" Value="0" /> <Setter Property="Padding" Value="1.25" /> <Style.Triggers> <MultiDataTrigger> <MultiDataTrigger.Conditions> <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True" /> <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="False" /> </MultiDataTrigger.Conditions> <MultiDataTrigger.Setters> <Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer1HighlightBrush}}" /> <Setter Property="BorderThickness" Value="1" /> <Setter Property="BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer1HighlightBorderBrush}}" /> <Setter Property="extensions:CursorSpotlightExtension.BackgroundBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer1IntenseHighlightBrush}}" /> <Setter Property="extensions:CursorSpotlightExtension.BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.Layer1IntenseHighlightBorderBrush}}" /> </MultiDataTrigger.Setters> </MultiDataTrigger> </Style.Triggers> </Style>
Hi, first of all thank you for this fantastic resource, it's an absolute time-and-eye-saver... dark themes are a necessity for survival!
It appears, however, that the maximise/restore button in the window control box of an AdonisWindow doesn't update when the WindowState changes, and I think it would be really nice to see the "restore down" icon when the window is maximised, and of course the "maximise" icon otherwise. Currently I only see the "maximise" icon.
Describe the bug
An exception is thrown when a textbox is present:
Exception thrown: 'MS.Internal.Xaml.Parser.GenericTypeNameParser.TypeNameParserException' in System.Xaml.dll
To Reproduce
If you add a textbox to the control, the output window will give an exception
Expected behavior
There should not be an exception
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
I have the following code:
xmlns:adonisExtensions="clr-namespace:AdonisUI.Extensions;assembly=AdonisUI"
....
<Grid.Resources>
<Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=(adonisExtensions:WatermarkExtension.IsWatermarkVisible)}"/>
</Style.Triggers>
</Style>
</Grid.Resources>
.....
<Grid>
<Textbox Text={Binding PropertyName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" adonisExtensions:WatermarkExtension.Watermark="" adonisExtensions:WatermarkExtension.IsWatermarkVisible="False"/>
</Grid>
While this does eliminate the watermark issue noted in #18 , the exception mart still occurs.
Is your feature request related to a problem? Please describe.
When using a toggle button in the windowchrome and the window looses focus, togglebuttons wont get the disabled style that windowbuttons get.
Describe the solution you'd like
Add a style for togglebuttons that mimics the behavior of the WindowButton style.
Describe alternatives you've considered
I could implement the style in my app, but i think adding a new style is in the scope of your library.
I would like there to be a messagebox that fits with the style of the white/dark theme. It's currently jarring when you have to use the default messagebox against a dark themed application.
A MessageBox that would inherit the light/dark styles currently available
I've considered making a custom messagebox using a standard window
When switching Window control to AdonisWindow, on startup application breaks with a XamlParseException and an inner exception with a message of: IOException: Cannot locate resource 'defaultstyles/calendar.xaml'.
To Reproduce
Expected behavior
Expect application to launch and window to appear.
Describe the bug
When utilizing the treeview items on mouseover do not highlight correctly.
Tested with .net Core 3, .net core 3.1, .net 4.8 and .net 4.7.2
Somehow this is not the case in the demo application and I cannot wrap my head around why it works there and nowhere else. (Maybe because the view is a resource dictionary ?)
To Reproduce
I have created an example app with code taken from the demo application
https://github.com/Swiftpaws/AdonisTreeView-Mouseover
Expected behavior
Mouseover highlight (border)
when we are started using adonisUI, we have to Install two assembly, one of them is AdonisUI.ClassicTheme. that bring me a lot of
I think you need to explain about that stuff, such as
will there will be any theme based on adonis?
If it's true maybe there will be more contributors, willing to collaborate (Metro, Fluent, etc).
how much dependent the adonis UI with the theme?
this will measure the breaking changes if there's other theme.
how to create new one or manipulating the existing?
if you provide guide for that, other will understand more and will use more.
how about the style naming conventions??
just like mahapps, will you provide naming convention like AdonisUI.Styles.Button
or AdonisUI.Brushes.Accent
thank you for your great library
I noticed, that the application output is filled with messages, that a BindingExpression path error occured, when using a ComboBox:
System.Windows.Data Error: 40 : BindingExpression path error: '(adonisExtensions:WatermarkExtension.IsWatermarkVisible)' property not found on 'object' ''ComboBox' (Name='')'. BindingExpression:Path=(adonisExtensions:WatermarkExtension.IsWatermarkVisible); DataItem='ComboBox' (Name=''); target element is 'TextBox' (Name='PART_EditableTextBox'); target property is 'NoTarget' (type 'Object')
Exception thrown: 'MS.Internal.Xaml.Parser.GenericTypeNameParser.TypeNameParserException' in System.Xaml.dll
System.Windows.Data Error: 40 : BindingExpression path error: '(adonisExtensions:WatermarkExtension.Watermark)' property not found on 'object' ''ComboBox' (Name='')'. BindingExpression:Path=(adonisExtensions:WatermarkExtension.Watermark); DataItem='ComboBox' (Name=''); target element is 'ContentPresenter' (Name='PlaceholderHost'); target property is 'Content' (type 'Object')
Exception thrown: 'MS.Internal.Xaml.Parser.GenericTypeNameParser.TypeNameParserException' in System.Xaml.dll
These two errors occur for every ComboBox in my view.
I'm using the latest version of AdonisUI (1.9), I haven't noticed this with earlier versions but I have not tested it specifically with other versions of AdonisUI.
This is the view, the error occurs, the following code snippet is the ComboBox in the view:
<ComboBox Grid.Column="0"
ItemsSource="{Binding InstallerBundles}"
SelectedItem="{Binding SelectedInstallerBundle}"
HorizontalContentAlignment="Stretch"
ScrollViewer.CanContentScroll="True"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling"
VirtualizingStackPanel.ScrollUnit="Pixel">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate >
<VirtualizingStackPanel/>
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
The view for an installer bundle consists of only a single TextBox:
<TextBlock TextTrimming="CharacterEllipsis"
Text="{Binding Name}"/>
There seems to be no error while using the application, I just wanted to check, if the errors can be ignored.
When a user clicks on a button the ripple effect starts to expand.
If the button becomes disabled in that time frame, the animation stops at its current state and remains visible until the button is enabled again.
When a control with a ripple effect is disabled, the ripple effect should not be displayed.
Describe the bug
If the application uses the AdonisWindow and is launched with anything but the base directory (where the .dll files are located) as the "Start in" location it will crash at:
AdonisUI.Controls.AdonisWindow.GetApplicationIcon()
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No crash
Screenshots
Additional context
The icon visibility in the adonis window does not affect this behaviour
Exception + StackTrace
System.Windows.Markup.XamlParseException: 'The invocation of the constructor on type 'Okami.Views.MainWindow' that matches the specified binding constraints threw an exception.'
FileNotFoundException: Could not load file or assembly 'C:\Users\pub\Downloads\Okami.dll'. The system cannot find the file specified.
This exception was originally thrown at this call stack:
System.Drawing.Icon.ExtractAssociatedIcon(string, int)
System.Drawing.Icon.ExtractAssociatedIcon(string)
AdonisUI.Controls.AdonisWindow.GetApplicationIcon()
AdonisUI.Controls.AdonisWindow.AdonisWindow()
Okami.Views.MainWindow.MainWindow()
It would be nice to have Rowheight and ColumnWidth constants like GridRowHeight1 and GridRowHeight2 etc. At the moment, you have to take care to use the same number in every view.
Describe the bug
When changing between the light and dark color theme at runtime, the Menu control stays with the original theme that was use at the startup time of the application.
To Reproduce
Use a menu with AdonisUI, and the Window Background Brush set as Layer0BackgroundBrush.
Start up the app, and then change Windows' color theme.
Expected behavior
It should change theme, as does the rest of the UI.
Screenshots
https://i.imgur.com/LCHlV6g.png
Additional context
The strange thing is that the text inside the menu works as expected, but its background does not.
You can check-out this repo and/or use the preview release to see it :
https://github.com/maximilien-noal/RoleDDNG
I am using Adonis UI in my app Image Sort. It really has been a great experience using it!
Now I've seen that you can suggest a project for the Expo page, so I thought I could maybe shamelessly suggest my own project!
Here is a screenshot:
Since we now have an Adonis Window it would be great if it followed the text scaling settings of Windows. This would help people with large resolutions and could help find style bugs.
A cursory search yielded https://docs.microsoft.com/en-us/windows/win32/hidpi/declaring-managed-apps-dpi-aware, which also links to demo code.
Of course, if nobody wants to tackle the feature i'll get myself to it eventually.
In the Layers (Complex) demo, tabbing to a progress bar shows some weird bounds. If you're cool with default behaviors, it might be nice to prevent KeyboardNavigation to ProgressBars, splitters, and other components
The toolbar button mouse over effect currently is barely noticeable.
I think that the style of the default button could be used to create an improved style.
Basically all that needs to be done is to clone the default button style and set the border brush to transparent.
If you have many buttons side by side (especially with icons as content) this just looks better imo.
Since the DataGrid styling has been merged i attempted to integrate adonis into my WPF program. The program makes extensive use of ContentControls, i also created my own to abstract adorned behaviour like a loading overlay etc.
I'm having issues with applying the datagrid style. I see controls like textboxes, checkboxes and scrollbars around and inside the DataGrid being styled, but the column row header, grid row header, grid row and spotlight are not being styled as expected.
I experimented further and placing the grid directly into the ShellView (Window object) doesn't fix it either. The grid styling just works within the Adonis Demo project, even with control relocations and other manipulations. I have no idea what else i could try.
My window currently looks like this;
Do you happen to know what i could do to debug this?
Thank you in advance
Describe the bug
If you disable the focusable element of the listview, the items you hover over have the default windows blue-white selection bar..
To Reproduce
Steps to reproduce the behavior:
1)Add the focusable element to an existing ListView code, as shown below:
<ListView ItemsSource="{Binding GameCollection}" VerticalAlignment="Stretch" MinHeight="150" ScrollViewer.VerticalScrollBarVisibility="Visible">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Focusable" Value="false"/>
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView>
<GridViewColumn DisplayMemberBinding="{Binding Path=ExePath}" Header="Exe Path"/>
<GridViewColumn DisplayMemberBinding="{Binding Path=IconPath}" Header="Icon Path"/>
<GridViewColumn DisplayMemberBinding="{Binding Path=ArgumentsString}" Header="Arguments"/>
</GridView>
</ListView.View>
</ListView>
Expected behavior
The ListViewItems would not show a change on hover or click
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Hey.
The problem here is that the newest version of AdonisUI does not seem to work correctly in different projects. I also tested version 1.6 which seems to work correctly.
Also a side note that i noticed that my fonts seem to be always bold when i use AdonisUI.
I dont know if this is intended because i did not had enough time testing this UI framework.
The issues i got when starting with a new project are
When creating a new window in an existing application i got the following issues
I of course followed the examples and the instructions given in this repository.
Thank you for your time :)
Is your feature request related to a problem? Please describe.
The dark color theme was too "purple" for my taste and I wanted to change it.
Describe the solution you'd like
A script to help shift the hue of the theme's colors.
I really am enjoying using adonis UI and I like the dark theme but I felt the color was slightly too purple and I was looking for more blue.
I wrote a small python script to extract the hex color strings from a resource dictionary, convert them to RGB and rotate them in HSV color space so the hue can be changed. Then convert them back to RGB, hex strings, and replace them in the resource dictionary. Then I just imported this new resource dictionary in App.xaml after adonis like the documentation says.
This worked out great and accomplished what I wanted. I thought I could share this here since others may want to do something similar. Perhaps include this in the project as some kind of helper script? Either way, I just wanted an issue to exist so if somebody was searching for this problem, I can offer one potential solution.
Thank you for your hard work on adonis, it is a great looking UI pack!
import re
from math import sqrt,cos,sin,radians
def clamp(v):
if v < 0:
return 0
if v > 255:
return 255
return int(v + 0.5)
class RGBRotate(object):
def __init__(self):
self.matrix = [[1,0,0],[0,1,0],[0,0,1]]
def set_hue_rotation(self, degrees):
cosA = cos(radians(degrees))
sinA = sin(radians(degrees))
self.matrix[0][0] = cosA + (1.0 - cosA) / 3.0
self.matrix[0][1] = 1./3. * (1.0 - cosA) - sqrt(1./3.) * sinA
self.matrix[0][2] = 1./3. * (1.0 - cosA) + sqrt(1./3.) * sinA
self.matrix[1][0] = 1./3. * (1.0 - cosA) + sqrt(1./3.) * sinA
self.matrix[1][1] = cosA + 1./3.*(1.0 - cosA)
self.matrix[1][2] = 1./3. * (1.0 - cosA) - sqrt(1./3.) * sinA
self.matrix[2][0] = 1./3. * (1.0 - cosA) - sqrt(1./3.) * sinA
self.matrix[2][1] = 1./3. * (1.0 - cosA) + sqrt(1./3.) * sinA
self.matrix[2][2] = cosA + 1./3. * (1.0 - cosA)
def apply(self, r, g, b):
rx = r * self.matrix[0][0] + g * self.matrix[0][1] + b * self.matrix[0][2]
gx = r * self.matrix[1][0] + g * self.matrix[1][1] + b * self.matrix[1][2]
bx = r * self.matrix[2][0] + g * self.matrix[2][1] + b * self.matrix[2][2]
return clamp(rx), clamp(gx), clamp(bx)
if __name__ == "__main__":
# xaml resource dictionary containing hex color strings
filename = 'colors.xaml'
with open(filename, 'r') as f:
text = f.read()
rotate = RGBRotate()
# rotate by this many degrees
rotate.set_hue_rotation(-17)
# find all hex color strings
m = re.findall(r'#(?:[a-fA-F0-9]{3}|[a-fA-F0-9]{6})\b', text)
for item in m:
# convert to rgb
r = (int(item[1:], 16) & 0xFF0000) >> 16
g = (int(item[1:], 16) & 0x00FF00) >> 8
b = (int(item[1:], 16) & 0x0000FF)
# rotate in hsv and convert back to rgb
r, g, b = rotate.apply(r, g, b)
# replace original with rotated color, original position matters!
text = text.replace(item, f'#{r:02x}{g:02x}{b:02x}')
with open(filename + '.out', 'w') as fout:
fout.write(text)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.