gix / presentationtheme.aero Goto Github PK
View Code? Open in Web Editor NEWA highly polished Windows Aero theme for WPF
Home Page: https://gix.github.io/PresentationTheme.Aero/
License: MIT License
A highly polished Windows Aero theme for WPF
Home Page: https://gix.github.io/PresentationTheme.Aero/
License: MIT License
It looks like a .net core app.
Suddenly, and for no apparent reason (it started happening while I was tracking down an unrelated bug in my project), MSBuild is copying the theme assemblies into the runtime\win\lib\netcoreapp3.0
subfolder. It did not do this before. As a result, the main assembly cannot find them and my app runs with the ugly default WPF theme. Please understand that this is an urgent issue for me, as I need to get the fix for that bug I mentioned above out as soon as possible, but this theme problem prevents me from doing a full release build, as then the theming won't work in the new version like it did in the old. Thanks!
dotnet --info
.NET SDK (reflecting any global.json):
Version: 5.0.100-rc.2.20479.15
Commit: da7dfa8840
Runtime Environment:
OS Name: Windows
OS Version: 10.0.20236
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100-rc.2.20479.15\
Host (useful for support):
Version: 5.0.0-rc.2.20475.5
Commit: c5a3f49c88
.NET SDKs installed:
3.0.100 [C:\Program Files\dotnet\sdk]
5.0.100-rc.2.20479.15 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0-rc.2.20475.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0-rc.2.20475.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0-rc.2.20475.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
What the title says, really. When I run my carefully crafted PresentationTheme.Aero
application on Windows 11, it looks very out-of-place since all of the common controls have had their theme bitmaps changed from their Windows 10 values. Being able to use this library to automatically have native-looking UI on both Windows 10 and Windows 11 would be really cool. Thanks!
(As a side note, you can easily check for Windows 11 by using the CurrentBuild
value under the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
registry key. If this value is 22000 or greater, the computer is running Windows 11. If not, the computer is running some build of Windows 10. This value is not affected by manifest versioning elements or lack thereof AFAIK.)
You will need to change ..\lib
to ..\..\lib
in the following lines:
PresentationTheme.Aero/Source/PresentationTheme.Aero.targets
Lines 7 to 12 in 1a12470
Without this change, the assemblies will not be copied into the output directory because MSBuild looks for them in the wrong location, therefore breaking use of this library on .NET Framework. Thanks!
Consider the following XAML:
<ListView aero:ThemeOptions.UseExplorerStyle="True">
<ListView.View>
<GridView>
<GridViewColumn CellTemplate="..." />
</GridView>
</ListView.View>
<ListView.Resources>
<Style x:Key="{x:Type ListViewItem}" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Static GridView.GridViewItemContainerStyleKey}}">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</ListView.Resources>
</ListView>
With the default WPF themes, this XAML will stretch any ListViewItem added to fill the entire column, while preserving the mouse-over effect of the default ListviewItem style. However, if i call AeroTheme.SetCurrentTheme()
first, no adjustment of XAML or control logic will result in the custom style shown above to be referenced; the theme default will always be used instead. Therefore, I cannot make the ListViewItem stretch to fill the entire row; it will always size itself as small as possible given the contents of its CellTemplate.
I have spent some time debugging this, to no avail. Could you please clarify what (if anything) I am doing wrong? Thanks!
Hi,
ToggleButton for all themes does not show IsChecked state - it is rendered as a Normal state. I am not sure if this is on purpose or not, however Windows 7 style displays checked toggle button correctly. I was annoyed by this, so I have changed this locally and it looks better. In order to fix it provide a name for element ButtonChrome
in style BaseButtonStyle
and add a following control template triggers:
<ControlTemplate.Triggers> <Trigger Property="IsKeyboardFocused" Value="true"> <Setter TargetName="Chrome" Property="RenderDefaulted" Value="true" /> </Trigger> <Trigger Property="ToggleButton.IsChecked" Value="true"> <Setter TargetName="Chrome" Property="RenderPressed" Value="true" /> </Trigger> </ControlTemplate.Triggers>
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.