Loic.sourcechord.FluentWPF 1.0.0

dotnet add package Loic.sourcechord.FluentWPF --version 1.0.0
                    
NuGet\Install-Package Loic.sourcechord.FluentWPF -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Loic.sourcechord.FluentWPF" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Loic.sourcechord.FluentWPF" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Loic.sourcechord.FluentWPF" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Loic.sourcechord.FluentWPF --version 1.0.0
                    
#r "nuget: Loic.sourcechord.FluentWPF, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Loic.sourcechord.FluentWPF&version=1.0.0
                    
Install Loic.sourcechord.FluentWPF as a Cake Addin
#tool nuget:?package=Loic.sourcechord.FluentWPF&version=1.0.0
                    
Install Loic.sourcechord.FluentWPF as a Cake Tool

<h1 align="center"> <img src="./logo.png" width="256"/><br /> FluentWPF </h1> <h4 align="center">Fluent Design System for WPF</h4>

Overview

  • Acrylic
    • AcrylicWindow
    • AcrylicBrush
  • Reveal
    • Reveal styles for controls(Button/TextBox/ListBox)
  • ParallaxView
  • AccentColors

Reveal

Install

NuGet Package

Install-Package FluentWPF

https://nuget.org/packages/FluentWPF

Preparation

Add XAML namespace.

xmlns:fw="clr-namespace:SourceChord.FluentWPF;assembly=FluentWPF"

Add ResourceDictionary to App.xaml.

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
             
            <ResourceDictionary Source="pack://application:,,,/FluentWPF;component/Styles/Controls.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

Usage

Acrylic

AcrylicWindow

AcrylicWindow

<fw:AcrylicWindow x:Class="WpfApp1.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:WpfApp1"
        xmlns:fw="clr-namespace:SourceChord.FluentWPF;assembly=FluentWPF"
        mc:Ignorable="d"
        Title="MainWindow" Height="300" Width="300">
    <Grid Background="#70FFFFFF">
        <TextBlock Margin="10"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="This is AcrylicWindow"
                   TextWrapping="Wrap" />
    </Grid>
</fw:AcrylicWindow>

Code Behind Remove base class definition.

public partial class MainWindow
{
    public MainWindow()
    {
        InitializeComponent();
    }
}
Properties
Property Name Type Description
TintColor Color Gets or sets the color tint for the semi-transparent acrylic material.
TintOpacity double Gets or sets the degree of opacity of the color tint.
NoiseOpacity double Gets or sets the degree of opacity of the noise layer.
FallbackColor Color Gets or sets the color when window is inactive.
AcrylicWindowStyle Normal </br> NoIcon </br> None Gets or sets a value that indicates the style of the Acrylic Window.

The difference between kind of AcrylicWindowStyle is demonstrated as follows,

AcrylicWindowStyle="Normal" AcrylicWindowStyle="NoIcon" AcrylicWindowStyle="None"
<img src="https://user-images.githubusercontent.com/14825436/58757611-25d06800-854a-11e9-8661-b79d9e249036.png" height="90"/> <img src="https://user-images.githubusercontent.com/14825436/58757615-37b20b00-854a-11e9-9512-966c912b15bb.png" height="90"/> <img src="https://user-images.githubusercontent.com/14825436/58757616-4bf60800-854a-11e9-85b3-bff1518849ec.png" height="90"/>
Using as Attached Property

AcrylicWindow can also be used as an Attached Property.

<Window x:Class="WpfApp1.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:WpfApp1"
        xmlns:fw="clr-namespace:SourceChord.FluentWPF;assembly=FluentWPF"
        mc:Ignorable="d"
        Title="AcrylicWindow2" Height="300" Width="300"
        fw:AcrylicWindow.Enabled="True">
    <Grid>
        
    </Grid>
</Window>

Code Behind

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }
}
AcrylicBrush

AcrylicBrush

<Window x:Class="FluentWPFSample.Views.AcrylicBrushSample"
        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:fw="clr-namespace:SourceChord.FluentWPF;assembly=FluentWPF"
        xmlns:local="clr-namespace:FluentWPFSample.Views"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        Title="AcrylicBrushSample"
        Width="640"
        Height="480"
        mc:Ignorable="d">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" />
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid x:Name="grid" Background="White">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <StackPanel>
                <Button Width="75" Margin="5" Content="Button" />
                <Button Width="75" Margin="5" Content="Button" />
                <Button Width="75" Margin="5" Content="Button" />
            </StackPanel>
            <Image Grid.Column="1"
                   Margin="5"
                   Source="/FluentWPFSample;component/Assets/Images/1.jpg" />
        </Grid>

        <Rectangle Grid.ColumnSpan="2"
                   Margin="40"
                   Fill="{fw:AcrylicBrush grid}"
                   Stroke="Black"
                   Visibility="{Binding IsChecked, ElementName=chkShowAcrylicLayer, Converter={StaticResource booleanToVisibilityConverter}}" />
        <CheckBox x:Name="chkShowAcrylicLayer"
                  Grid.Row="1"
                  Margin="5"
                  HorizontalAlignment="Left"
                  Content="Show Acrylic Rect"
                  IsChecked="True" />
    </Grid>
</Window>

Reveal

Reveal effect for controls.

To use the reveal effect, set fw:PointerTracker.Enabled="True" on a parent container.

Reveal

<Grid fw:PointerTracker.Enabled="True" Background="#01FFFFFF" Margin="3">
    <StackPanel>
        <Button Content="Button" HorizontalAlignment="Left" Margin="5" Width="75" Height="32"
                Style="{StaticResource ButtonRevealStyle}"/>

        <Button Content="Button" HorizontalAlignment="Left" Margin="5" Width="75" Height="32"
                Background="Transparent"
                Style="{StaticResource ButtonRevealStyle}"/>

        <TextBox HorizontalAlignment="Left" Height="23" Margin="5" Text="TextBox" Width="120"
             Style="{StaticResource TextBoxRevealStyle}"/>
    </StackPanel>
</Grid>
Styles
Control Style Name
Button ButtonRevealStyle
Button ButtonAccentRevealStyle
Button ButtonRoundRevealStyle
Button ButtonRoundAccentRevealStyle
TextBox TextBoxRevealStyle
PasswordBox PasswordBoxRevealStyle
ListBox ListBoxRevealStyle

ParallaxView

ParallaxView

<Grid>
    <fw:ParallaxView VerticalShift="200" HorizontalShift="200"
                     Source="{Binding ElementName=list}">
        <Image Source="/FluentWPFSample;component/Assets/Images/1.jpg" Stretch="UniformToFill"/>
    </fw:ParallaxView>
    <ListBox x:Name="list" Background="#88EEEEEE" ScrollViewer.CanContentScroll="False"
             ItemsSource="{Binding Items}"/>
</Grid>
Properties
Property Name Type Description

AccentColors

Brushes

<StackPanel Margin="5">
    <StackPanel.Resources>
        <Style TargetType="Border">
            <Setter Property="Width" Value="120" />
            <Setter Property="Height" Value="120" />
            <Setter Property="Margin" Value="3" />
            <Setter Property="BorderBrush" Value="Black" />
            <Setter Property="BorderThickness" Value="1" />
        </Style>
        <Style TargetType="TextBlock">
            <Setter Property="TextWrapping" Value="Wrap" />
            <Setter Property="VerticalAlignment" Value="Bottom" />
            <Setter Property="FontSize" Value="14" />
        </Style>
    </StackPanel.Resources>
    <StackPanel Orientation="Horizontal" Margin="5">
        <Border Background="{x:Static fw:AccentColors.ImmersiveSystemAccentBrush}">
            <TextBlock Text="ImmersiveSystemAccentBrush" />
        </Border>
    </StackPanel>
    <StackPanel Orientation="Horizontal" Margin="5">
        <Border Background="{x:Static fw:AccentColors.ImmersiveSystemAccentLight1Brush}">
            <TextBlock Text="ImmersiveSystemAccentLight1Brush"/>
        </Border>
        <Border Background="{x:Static fw:AccentColors.ImmersiveSystemAccentLight2Brush}">
            <TextBlock Text="ImmersiveSystemAccentLight2Brush"/>
        </Border>
        <Border Background="{x:Static fw:AccentColors.ImmersiveSystemAccentLight3Brush}">
            <TextBlock Text="ImmersiveSystemAccentLight3Brush" />
        </Border>
    </StackPanel>
    <StackPanel Orientation="Horizontal" Margin="5">
        <Border Background="{x:Static fw:AccentColors.ImmersiveSystemAccentDark1Brush}">
            <TextBlock Text="ImmersiveSystemAccentDark1Brush" Foreground="White"/>
        </Border>
        <Border Background="{x:Static fw:AccentColors.ImmersiveSystemAccentDark2Brush}">
            <TextBlock Text="ImmersiveSystemAccentDark2Brush" Foreground="White"/>
        </Border>
        <Border Background="{x:Static fw:AccentColors.ImmersiveSystemAccentDark3Brush}">
            <TextBlock Text="ImmersiveSystemAccentDark3Brush" Foreground="White"/>
        </Border>
    </StackPanel>
</StackPanel>
Accent Color

Accent color depends on the accent color of the system.

Sample Color Brush
#a6d8ff ImmersiveSystemAccentLight3 ImmersiveSystemAccentLight3Brush
#76b9ed ImmersiveSystemAccentLight2 ImmersiveSystemAccentLight2Brush
#429ce3 ImmersiveSystemAccentLight1 ImmersiveSystemAccentLight1Brush
#0078d7 ImmersiveSystemAccent ImmersiveSystemAccentBrush
#005a9e ImmersiveSystemAccentDark1 ImmersiveSystemAccentDark1Brush
#004275 ImmersiveSystemAccentDark2 ImmersiveSystemAccentDark2Brush
#002642 ImmersiveSystemAccentDark3 ImmersiveSystemAccentDark3Brush

Usage:

 <Border Background="{x:Static fw:AccentColors.ImmersiveSystemAccentBrush}"/>
 <Border Background="{Binding Path=(fw:AccentColors.ImmersiveSystemAccentBrush)}"/>
Base Color
Light Dark Color Brush
#000000 #ffffff SystemBaseHighColor SystemBaseHighColorBrush
#333333 #cccccc SystemBaseMediumHighColor SystemBaseMediumHighColorBrush
#666666 #999999 SystemBaseMediumColor SystemBaseMediumColorBrush
#999999 #666666 SystemBaseMediumLowColor SystemBaseMediumLowColorBrush
#cccccc #333333 SystemBaseLowColor SystemBaseLowColorBrush

Usage:

 <Border Background="{DynamicResource SystemBaseHighColorBrush}"/>
Alt Color
Light Dark Color Brush
#ffffff #000000 SystemAltHighColor SystemAltHighColorBrush
#cccccc #333333 SystemAltMediumHighColor SystemAltMediumHighColorBrush
#999999 #666666 SytemAltMediumColor SytemAltMediumColorBrush
#666666 #999999 SystemAltMediumLowColor SystemAltMediumLowColorBrush
#333333 #cccccc SystemAltLowColor SystemAltLowColorBrush

Usage:

 <TextBlock Foreground="{DynamicResource SystemAltHighColorBrush}"/>
Chrome Color
Light Dark Color Brush
#CCCCCC #767676 SystemChromeHighColor SystemChromeHighColorBrush
#E6E6E6 #1F1F1F SytemAltMediumColor SytemAltMediumColorBrush
#F2F2F2 #2B2B2B SystemChromeMediumLowColor SystemChromeMediumLowColorBrush
#F2F2F2 #171717 SystemChromeLowColor SystemChromeLowColorBrush

Usage:

 <Border Background="{DynamicResource SystemChromeMediumBrush}"/>
Opacity Color

Windows includes a set of colors that differ only by their opacities:

Base Color Opacity Color Brush
#000000 FF SystemChromeBlackHighColor SystemChromeBlackHighColorBrush
#000000 CC SystemChromeBlackMediumColor SystemChromeBlackMediumColor
#000000 66 SystemChromeBlackMediumLowColor SystemChromeBlackMediumLowColorBrush
#000000 33 SystemChromeBlackLowColor SystemChromeBlackLowColorBrush
#FFFFFF 33 SystemListMediumColor SystemListMediumColorBrush
#FFFFFF 19 SystemListLowColor SystemListLowColorBrush
Other Colors
Light Dark Color Brush
#FFFFFF #FFFFFF SystemChromeWhiteColor SystemChromeWhiteColorBrush
#171717 #F2F2F2 SystemChromeAltLowColor SystemChromeAltLowColorBrush
#CCCCCC #333333 SystemChromeDisabledHighColor SystemChromeDisabledHighColorBrush
#7A7A7A #858585 SystemChromeDisabledLowColor SystemChromeDisabledLowColorBrush

License

MIT License

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 1 7/31/2021