Skip to content

Simple sample to use WPF-UI package with Revit API.

License

Notifications You must be signed in to change notification settings

ricaun-io/RevitAddin.WpfUi.Sample

Repository files navigation

RevitAddin.WpfUi.Sample

Revit 2019 Visual Studio 2022 Nuke License MIT Build

This project was generated by the ricaun.AppLoader Revit plugin.

Wpf.Ui

This project use an alternative version of the Wpf.Ui version 3.0.4 design with the feature ApplicationThemeManager.Apply(this); to apply the theme in the main Window.

Wpf.Ui.Sample.gif

The package Revit.Wpf.Ui is a fork of the original package with some changes to work with Revit 2025.

The main change is the PR Update UiApplication.cs to fix Revit 2025 incompatibility, the package id changed to REVIT-WPF-UI and the assembly is Revit.Wpf.Ui.3.0.4 to avoid conflicts with the original package.

The folder References contains the REVIT-WPF-UI.3.0.4.nupkg package with the nuget.config file to use the local package.

Usage

Apply the theme in the main Window or Page using the ApplicationThemeManager.Apply(this); method.

public partial class MainWindow
{
    public MainWindow()
    {
        InitializeComponent();
        ApplicationThemeManager.Apply(this);
    }
}

Use ui:FluentWindow to enable the Fluent Design in the Window.

<ui:FluentWindow
  ...
  xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
  ExtendsContentIntoTitleBar="True"
  WindowBackdropType="Auto"
  >
  <StackPanel>
      <ui:TitleBar Title="WPF UI"/>
      <ui:Card Margin="8">
          <ui:Button Content="Hello World" Icon="{ui:SymbolIcon Fluent24}" />
      </ui:Card>
  </StackPanel>
</ui:FluentWindow>

Using Page to apply the background and foreground.

<Page
    ...
    Background="{DynamicResource ApplicationBackgroundBrush}"
    Foreground="{DynamicResource TextFillColorPrimaryBrush}"
    >
</Page>

Video

Video in English about this project.

VideoIma1 VideoIma2

Installation

License

This project is licensed under the MIT License.


Do you like this project? Please star this project on GitHub!