Du.PMPage.Wpf
A WPF-based library for creating SolidWorks PropertyManager Pages (PMPage) using XAML. Provides WPF wrappers for native SolidWorks COM controls including buttons, checkboxes, comboboxes, selection boxes, number boxes, group boxes, tabs, and WindowFromHandle content hosts. Supports two-way data binding, design-time previews, and XAML-based layout.
Install
| Product | Versions |
|---|---|
| Other |
README
PMPage Control
A WPF framework for developing SolidWorks PropertyManager Pages (PMPage) using XAML and data binding β no handler code required.
δΈζζζ‘£ | English Documentation | δΈζζζ‘£
Features
- XAML-first design β declare PMPage controls, layouts, and bindings declaratively
- No Handler code β no
PMPageHandler.cs; the framework handles all COM interop - Full data binding β all properties support WPF
{Binding}, two-way by default on value properties - MVVM-ready β works with any WPF MVVM framework
- Design-time preview β controls render placeholders in the Visual Studio designer
- Native SW controls β wraps all SolidWorks PMPage control types
- Multi-tab β native SW tabs via
SldTabControl - WPF content hosting β embed any WPF UI inside a PMPage via
SldContentHost - TaskPane support β host WPF UserControls inside SW Task Panes
Requirements
- .NET Framework 4.8
- SolidWorks 2018+ (
IPropertyManagerPage2Handler9support)
Installation
Install the package from NuGet:
dotnet add package Du.PMPage.Wpf
Or via Package Manager Console:
Install-Package Du.PMPage.Wpf
Or add the PackageReference directly:
<PackageReference Include="Du.PMPage.Wpf" Version="0.0.2" />
Quick Start
1. Add a WPF UserControl that inherits from SldPMPage
<pmp:SldPMPage
x:Class="MyAddin.MyPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:pmp="https://github.com/weianweigan/PMPageControl/wpf"
PageTitle="My Feature"
PageHeight="500">
<pmp:SldGroupBox Caption="Settings">
<pmp:SldTextBox SldCaption="Name" Text="{Binding Name}" />
<pmp:SldNumberBox SldCaption="Size" Value="{Binding Size}"
Minimum="1" Maximum="100" />
</pmp:SldGroupBox>
</pmp:SldPMPage>
2. Code-behind
public partial class MyPage : SldPMPage
{
public MyPage() { InitializeComponent(); }
public MyPage(ISldWorks sw) : this()
{
App = sw; // Must be set before ShowPage()
DataContext = new MyViewModel();
}
}
3. Show the page
var page = new MyPage(SwApp);
page.ShowPage();
Controls
Containers
| Control | Description |
|---|---|
SldPMPage |
Root page control |
SldGroupBox |
Collapsible group with caption |
SldTabControl |
Native SW tab container |
Input Controls
| Control | Description |
|---|---|
SldTextBox |
Text input |
SldNumberBox |
Numeric input with range limits |
SldCheckBox |
Checkbox toggle |
SldOption |
Radio button |
SldCombobox |
Dropdown list (static or editable) |
Display Controls
| Control | Description |
|---|---|
SldLabel |
Read-only text label |
SldLabelMsg |
Warning/status label (yellow background) |
Action Controls
| Control | Description |
|---|---|
SldButton |
Standard push button |
SldBitmapButton |
Button with SW standard icon |
SldCheckableBitmapButton |
Toggle button with SW icon |
Advanced Controls
| Control | Description |
|---|---|
SldSelectionBox |
Entity selection with type filtering |
SldContentHost |
Host arbitrary WPF content |
WPF-Only Controls
| Control | Description |
|---|---|
NumberBox |
Numeric input TextBox |
IOTextBox |
TextBox with proper SW dialog keyboard handling |
Validation
// CloseCommand validation
CloseCmd = new CloseCommand(
execute: OnOk,
canExecute: () => IsFormValid,
cancelClick: OnCancel)
{
ErrorTitle = "Validation Failed",
BubbleTooltip = "Please fill in all required fields."
};
// Closing event validation
Closing += (reason, arg) =>
{
if (!ViewModel.IsValid)
{
arg.Cancel = true;
arg.ErrorTitle = "Cannot Complete";
arg.ErrorMessage = "Part name is required.";
}
};
Documentation
Samples
PMPageAddin/β SolidWorks add-in with full control demos
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.