sourcechord / fluentwpf Goto Github PK
View Code? Open in Web Editor NEWFluent Design System for WPF.
License: MIT License
Fluent Design System for WPF.
License: MIT License
When hovering over an element that supports Reveal Effect, the highlight color shows up gradually as an animation (Duration="0:0:0.600"), but considering that in UWP applications, the default Reveal Effect actually shows the highlight color of an element immediately when hovering over an element, I think the duration of the opacity animation of "backgroundBorder" triggered by hovering over should be set to 0.
@sourcechord Hi, is there any way to force FluentWPF to use a light or dark theme?
Is it possible to force FluentWPF to pretend that the user set the 'App mode' switch in settings to, say, dark?
I have tried swapping out my App.xaml reference <ResourceDictionary Source="pack://application:,,,/FluentWPF;component/Styles/Controls.xaml" />
for .../Styles/Colors.Dark.xaml
This correctly changed the color of the window title (ie 'MainPage' or whatever); but doesn't swap out the window control buttons in the top right corner for the appropriate theme. See Picture:
SourceChord.FluentWPF.SystemTheme.Theme
(which I think is what I am trying to change for this effect) can't be set. Is something like this currently possible with this library?
Similar Issue: #1 (Closed with no solution)
Thanks in Advance,
Andrew Mitchell
In the Readme file, the Calculator demo shows that some of the buttons have a blue reveal highlight color, but I can't work out how to go about setting this.
Thanks :)
Edit:
Worked it out for anyone else interested, it's not exposed directly; you need to change the following:
FluentWPF/FluentWPF/Styles/Button.xaml
Lines 328 to 333 in 8ba5762
to
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="root" Property="Background">
<Setter.Value>
<SolidColorBrush Color="{Binding ButtonBackground.Color}" Opacity="0.8" />
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
See title.
Is there any event or something similar that indicates change of Windows 10 dark/light mode?
Since this is a traditional thing and some people would want to do this anyway. Why not?
Out of the box on the following line in the Sample:
SystemTheme.ThemeChanged += SystemTheme_ThemeChanged;
'FluentWPFSample.exe' (CLR v4.0.30319: FluentWPFSample.exe): Loaded 'C:\Users\Matthew\Desktop\Fluent Design System\FluentWPF\FluentWPF-master\Sample\FluentWPFSample\bin\Debug\FluentWPF.dll'. Symbols loaded.
Exception thrown: 'System.NullReferenceException' in FluentWPF.dll
Exception thrown: 'System.TypeInitializationException' in FluentWPF.dll
An exception of type 'System.TypeInitializationException' occurred in FluentWPF.dll but was not handled in user code
The type initializer for 'SourceChord.FluentWPF.SystemTheme' threw an exception.
Out of the box on finding the Controls.xaml in my own WPF Sample using FluentWPF from NuGet:
<Application.Resources>
<ResourceDictionary.MergedDictionaries>
</ResourceDictionary.MergedDictionaries>
</Application.Resources>
An error occurred while finding the resource dictionary "pack://application:,,,/FluentWPF;component/Styles/Controls.xaml".
Guess I am going back to Mahapps since something is definitively not up to scratch here for a VS2017 OOTB FluentWPF experience to even consider further exploration let alone actual use..
When using let's say:
MyFrame.Navigate(Activator.CreateInstance(Type.GetType("Application.Pages.Test")));
The page is drawn to the frame but the text comes as black. If the Windows is in Dark Mode, I can't read the text since my BG is also black.
If I change the windows mode to Light and goes back to Dark with the page not created yet and then load the page, the color of the text is correctly white. Also if changing the windows color mode while the page is loaded also correctly updates the text color.
Do I need to call some method to updated the colors when creating a page?
Before the 0.3.1 it runs on all versions of Windows 10 but not Windows 7. But in new version, it does run on Windows 7 and all versions of Windows 10 except 1703.
Below are exception details found on Event Viewer:
Application: .exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException at SourceChord.FluentWPF.SystemTheme.GetTheme() at SourceChord.FluentWPF.SystemTheme..cctor() Exception Info: System.TypeInitializationException at SourceChord.FluentWPF.SystemTheme.add_ThemeChanged(System.EventHandler) at SourceChord.FluentWPF.ResourceDictionaryEx..ctor() Exception Info: System.Windows.Markup.XamlParseException at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri) at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean) at System.Windows.Application.LoadComponent(System.Object, System.Uri) at .App.InitializeComponent() at .App.Main()
Version: Windows 10 1903
UI appears after pressing Windows + Shift + S and leaving it.
Code:
DesktopBGui BGui = new DesktopBGui
{
Owner = GetWindow(this)
};
BGui.ShowDialog();
Opens just fine while running in visual studio debugging. But in the compiled release version outside of Visual Studio this happens.
For example I want to make my window's background color black, but because of text's and buttons icon's initial black color it destroys a good appearance of application and in same time just very uncomfortable.
Is there any possibility to do it?
I've created a textbox control based on the original textbox and added a placeholder property in it.
Sample usage:
<fw:FluentTextBox PlaceHolder="Enter anything" Padding="5" Margin="5" Width="120" HorizontalAlignment="Left"/>
I wonder if I can contribute this one (and future fluent-based controls) to this project.
Thanks.
:)
AccentColors seems only run in window 8 or later. It can not run in windows 7 system.should it provide a default color setting or some kind styles to select when in windows 7?
Since the named value might not exist, you should provide a default value to the GetValue call, otherwise you may end with a NullReferenceException when casting to int...
When the window loses focus the caption buttons cannot be clicked as in a standard window. You must first click the window to make it active and then the buttons are active. Closing a window takes two clicks.
I am using the AcrylicWindow TitleBar property after upgrading to 0.7 to get the 1903 fix. However, it doesn't work if you enable the AcrylicWindow using the AcrylicWindow.Enabled attached property.
Installed the nuget package and followed the examples. Got an AcrylicWindow with a grid where PointerTracker.Enabled is set to true. Then stackpanel then the buttons in the example with the styles ButtonRevealStyle.
When I launch the app the output automatically gives lots of binding errors:
System.Windows.Data Error: 17 : Cannot get 'IsEnter' value (type 'Boolean') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=53954942); target property is 'Opacity' (type 'Double') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'RootObject' value (type 'UIElement') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=53954942); target property is 'Center' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'Position' value (type 'Point') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=53954942); target property is 'Center' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'RootObject' value (type 'UIElement') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=53954942); target property is 'GradientOrigin' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'Position' value (type 'Point') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=53954942); target property is 'GradientOrigin' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Error: 17 : Cannot get 'IsEnter' value (type 'Boolean') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=15832433); target property is 'Opacity' (type 'Double') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'RootObject' value (type 'UIElement') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=15832433); target property is 'Center' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'Position' value (type 'Point') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=15832433); target property is 'Center' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'RootObject' value (type 'UIElement') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=15832433); target property is 'GradientOrigin' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'Position' value (type 'Point') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=15832433); target property is 'GradientOrigin' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Error: 17 : Cannot get 'IsEnter' value (type 'Boolean') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=11244347); target property is 'Opacity' (type 'Double') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'RootObject' value (type 'UIElement') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=11244347); target property is 'Center' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'Position' value (type 'Point') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=11244347); target property is 'Center' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'RootObject' value (type 'UIElement') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=11244347); target property is 'GradientOrigin' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Warning: 17 : Cannot get 'Position' value (type 'Point') from '' (type 'SharedDp'). BindingExpression:Path=(0); DataItem='SharedDp' (HashCode=20908074); target element is 'RadialGradientBrush' (HashCode=11244347); target property is 'GradientOrigin' (type 'Point') InvalidCastException:'System.InvalidCastException: The object of the type "System.Windows.SharedDp" can not be in type "System.Windows.DependencyObject" being transformed.
at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)
at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Window', AncestorLevel='1''. BindingExpression:Path=(0); DataItem=null; target element is 'SolidColorBrush' (HashCode=20798117); target property is 'Color' (type 'Color')
Hi, I'm using Windows 10 1803, the AcrylicWindow only uses "Blur Behind" effect instead of "Acrylic Blur Behind" (which has a larger blur radius).
I found these corresponding codes in AcrylicWindow.cs
:
if (currentVersion >= VersionInfos.Windows10_1809)
{
accent.AccentState = AccentState.ACCENT_ENABLE_ACRYLICBLURBEHIND;
}
else if (currentVersion >= VersionInfos.Windows10)
{
accent.AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND;
}
else
{
accent.AccentState = AccentState.ACCENT_ENABLE_TRANSPARENTGRADIENT;
}
As far as I know, AccentState.ACCENT_ENABLE_ACRYLICBLURBEHIND
is available since Windows 10 1803.
And these codes apply this effect only >= 1809, will this effect causes bugs in 1803?
Just I install the "Windows Community Toolkit Sample App",in the sample ,using the liked AcrylicBrush is easy:
<Border.Background>
<media:BackdropBlurBrush Amount="7.95" />
</Border.Background>
so can you cancel the target assign?
the other needs,can you design the full theme like the "Xaml controls gallery"? it is very cool!
Hello! I am trying to make a small application with fixed MainWindow using FluentWPF.
It also looks like that AcrylicWindows is not supporting minimize/maximize button disabling.
When you make your window Fixed, acrylic window is still resizable and also a small exit button appears under somewhat like "hardcoded" minimize, maximize and exit button, these buttons still working after property change.
Any workaround?
Can you use the windows10 spring creator's Fluent API?
Now You using the effect like the windows7's Aero ,the newest Telerik WPF Controls use it too.
but it's fuzzy effect is not enough strong,the background icon is too clear.
the DevExpress's Winform controls(V18.1) use the window10's fluent API,
the fuzzy effect is very good,it is better than the window10 self APP,because
it's fuzzy effect between the windows7's Aero and window10's Fluent Design.
<Button Grid.Row="1" Grid.Column="1" Name="btn_bugreport" Margin="5" Height="30" Style="{StaticResource ButtonRevealStyle}">
<StackPanel>
<Image Source="Resources/bug.png"/>
</StackPanel>
</Button>
This snippet is inside my main grid, I want a button to show an picture for bugreport. (the Google Material Icon)
The Image shows in the Visual Studio Designer, but not during runtime. Did I miss something?
As a matter of effekt, I have more than one button. If I hover over one Button, all Buttons do hover animations (i think it is a shadow around the box). Is this normal? EDIT: Nevermind, my Buttons are next to each other, this is why i thought they react the same.
First: Thanks for your software. This is a great idea, especially for implementing an easy dark mode.
The light theme looks pretty beautiful, but in my opinion the dark mode not.
The background colour of the window is still to bright, it should be a bit darker.
And the contrast between buttons and window colour are too small, so you can't see the buttons properly.
Would be nice if you can fix these issues.
Thank you!
The result is that in tablet mode you can't put your app with AcrylicWindow.Enabled side by side with other apps. There is no problem when the feature is off.
Hi,
when using ExtendViewIntoTitleBar="True" the titlebar will still act as a drag area even though content is now extending into it. Is there any way to display content above this are?
When maximizing a window, the titlebar is cropped on the top side. doesnt look nice and isnt touch friendly
Windows 10 introduced a light theme for the Startmenu, Taskbar etc.
Would be great if we could get these colors from the AccentColors
Hi!
I would really like to use the AcrylicBrush for our project. We have a custom control, we call 'Panel' which has a header with a title and some content. We'd like to have that panel to have a blurred background, but since we use it everywhere we need the target to be dynamic.
What we would like is something like:
<Grid Background="{fw:AcrylicBrush Target={Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
Is that possible? Is the Target bindable?
With .NET core 3.0.0 supporting WPF. Targeting FluentWPF library to support it would be nice as we can get all the improvements of .Net core while using WPF.
I managed to convert the project to core 3.0 without much problems on my fork. Just needed to add System.Management
from Windows.Compatability
from nuget. I think it'd be a great addition to target.
The official Acrylic effect has a much stronger gaussian blur than the latest version of FluentWPF.
I dont want users to have the ability to resize my window but i still want them to minimise it when they want it.
It won't start the app, when checked the Event viewer it shows:
Application: Test.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
at SourceChord.FluentWPF.SystemTheme.GetTheme()
at SourceChord.FluentWPF.SystemTheme..cctor()
Exception Info: System.TypeInitializationException
at SourceChord.FluentWPF.SystemTheme.add_ThemeChanged(System.EventHandler)
at SourceChord.FluentWPF.ResourceDictionaryEx..ctor()
Exception Info: System.Windows.Markup.XamlParseException
at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
at System.Windows.Application.LoadComponent(System.Object, System.Uri)
at Test.App.InitializeComponent()
at Test.App.Main()
Hi, I just upgraded to Windows 10 1903 and noticed that using the titlebar to drag a window has a very high latency, lagging behind the cursor movements by seconds.
I'm using the AcrylicWindow with ExtendViewIntoTitleBar="True"
Thanks for any updates.
If I hide the Title Bar then the window controls disappear. Is there a way to remove it and keep these controls (so the content, such as tabs, could be moved to the top of the window, as in Edge)
System.Windows.Data Error: 40 : BindingExpression path error: 'ExtendViewIntoTitleBar' property not found on 'object' ''MainWindow' (Name='Window')'. BindingExpression:Path=ExtendViewIntoTitleBar; DataItem='MainWindow' (Name='Window'); target element is 'ContentPresenter' (Name=''); target property is 'NoTarget' (type 'Object')
Probably caused by line 280 in Window.xaml
I just pulled down v0.8.0 from nuget and it looks like brushes.xaml is missing, so the app crashes when i try to use FluentWPF
Hi, When using fw:AcrylicWindow.Enabled="True", the window border does not change when the system accent color changes.
The only options I'm presented with are TilteBar and TitleBarMode.
TitleBar requires "" but does not support converting to string.
How to apply fw:AcrylicBrush grid to Border background.
This won't work:
Background="{fw:AcrylicBrush grid}"
When setting the ButtonRevealStyle
, there is no visible difference between an enabled and disabled button style:
<Button Style="{StaticResource ButtonRevealStyle}">Foo</Button>
When using two monitors, the window goes to the second screen. When you turn on the Acrylic effect
https://a.icons8.com/pNoVVVlQ/lkL8Uu/2018-12-27_17-40-47.png
Any idea how to fix this?
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.