Floxel 1.1.0

dotnet add package Floxel --version 1.1.0
NuGet\Install-Package Floxel -Version 1.1.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="Floxel" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Floxel --version 1.1.0
#r "nuget: Floxel, 1.1.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.
// Install Floxel as a Cake Addin
#addin nuget:?package=Floxel&version=1.1.0

// Install Floxel as a Cake Tool
#tool nuget:?package=Floxel&version=1.1.0

FloxelUI

Material Design UI for Windows Presentation Foundation (WPF). Made for private use, but anyone can use it if they want to.

What is FloxelUI?

FloxelUI is a UI library for WPF that is based on Google's Material Design guidelines. It is designed to be easy to use and to look good. It's not a one-to-one copy of the Material Design guidelines, but it's main purpose is to look better than the default WPF UI.
It is also designed to be customizable, so you can change the colors and other things to your liking.
Library also comes with many utilities that make it easier to use WPF, such as a RelayCommand class that can be used to bind commands to buttons, and a BaseViewModel class that can be used to bind data to the UI. You can check full list of utilities in the Features section.

How do I use it?

First, you'll need to reference the library in your project. You can do this by adding a nuget package to your project (currently, only local nuget package is available, check releases for more info).
Then, you'll need to initialize the library. You can do this by adding a reference to the library in your App.xaml file.

<Application x:Class="MyApp.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:fui="clr-namespace:FloxelLib;assembly=Floxel"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <fui:Resources/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

Next, you'll need to also initialize every window that you want to use the library in. You can do this by calling Floxel.InitWindow(this); in the constructor of the window.

public partial class MainWindow : Window
{
	public MainWindow()
	{
		Floxel.InitWindow(this);
		InitializeComponent();
	}
}

Doing all of this will make sure all styles, controls and other things are loaded correctly.
Alternatively, you can just use custom Window class that is provided by the library.

<fuic:Window x:Class="MyApp.MainWindow"
             xmlns:fuic="clr-namespace:FloxelLib.Controls;assembly=Floxel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid>
        
    </Grid>
</fuic:Window>

Customization

You can easily change app theme by calling Floxel.SetTheme(theme); from anywhere in your code.

Floxel.SetTheme(Floxel.DarkTheme);

There are two themes available: Floxel.DarkTheme and Floxel.LightTheme.
You can also get the current theme from Floxel.CurrentTheme.
Also, you can pass in any path to a XAML file as a theme.

Floxel.SetTheme("Themes/MyTheme.xaml");

or to a local file on your computer

Floxel.SetTheme("C:/Users/MyUser/MyTheme.xaml", UrlKind.Absolute);

MVVM utilities

BaseViewModel

BaseViewModel is a class that can be used to bind data to the UI. It implements the INotifyPropertyChanged interface, so you can use it to notify the UI when a property changes.
UpdateProperty is an attribute that can generate a property for your field. Here's an example of how to use it:

public class MyViewModel : BaseViewModel
{
    [UpdateProperty]
    private string _myText = "Hello World!";

    [UpdateProperty("UpdateMyBool();")] // You can pass extra code to be executed when the property changes
    private bool _myBool = true;

    private void UpdateMyBool() 
    {
        // Do something
    }

    [UpdateProperty]
    private int _myInt1, _myInt2 = 5; // You can also update multiple fields at once
}
<TextBox Text="{Binding MyText}"/>

Note that you can use SetField method to set the value of the field and notify the UI at the same time.

RelayCommand

In order to bind commands to buttons, you can use the RelayCommand class. It is a class that implements the ICommand interface, so you can use it to bind commands to buttons.
Here's an example of how to use it:

public class MyViewModel : BaseViewModel
{
    [RelayCommand]
    private void Test(object arg) {
        MessageBox.Show(arg.ToString());
    }
}
<Button Content="Click me!" Command="{Binding TestCommand}" CommandParameter="Hello World!"/>

Features

  • Material Design
  • Customizable colors
  • MVVM utilities (BaseViewModel, RelayCommand)
  • Theme support (Dark, Light)
  • Application State manager (utility for saving and loading application state)
  • Custom MessageBox (with support for themes)
  • Spinning Progress Circle
  • Material Design Icons (full icon list)
  • Converters for binding values
  • Useful extensions for build-in types
  • Custom Stopwatch class that is built on top of the System.Diagnostics.Stopwatch class, but uses .NET 7 style of time measurement (doesn't allocate memory on heap)

Work in progress

Control Styles

  • Window
  • RadioButton
  • TabControl
  • Button
  • ScrollBar
  • TextBox
  • CheckBox
  • ComboBox
  • Slider
  • ProgressBar
  • more coming soon...

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1.0 244 11/2/2023
1.0.8 126 10/26/2023
1.0.7.1 115 10/9/2023