1.首先创建你的WPF工程
2.从Nuget中安装HandyControl
VS2017默认已经集成Nuget包管理工具,直接搜索 HandyControl 安装即可
3.在App.xaml中加入如下代码
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" />
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
4.添加界面代码
<Window x:Class="WpfApp3.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:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
xmlns:local="clr-namespace:WpfApp3"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<WrapPanel>
<controls:RadioGroup Margin="5,16,0,0"
Style="{StaticResource RadioGroupSolid}"
Width="200">
<RadioButton Content="全部" />
<RadioButton Content="未发货"/>
<RadioButton Content="已发货"
IsChecked="True"
/>
</controls:RadioGroup>
</WrapPanel>
</Grid>
</Window>
5.编译 运行 妥妥的没问题 感谢 NaBian
git项目地址:https://github.com/NaBian/HandyControl
后续使用过程中有新体会将持续分享给大家,记得关注哦 这个WPF开源控件项目非常给力,强烈建议大家尝试下