且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 WPF 用户控件库中隐藏控件

更新时间:2023-02-20 18:24:37

使这些控件成为内部控件.如果您有带有 XAML 和代码隐藏的经典用户控件,则需要将 x:ClassModifier="internal" 添加到 XAML 中的根元素:

Make those controls internal. If you have classic UserControls with XAML and codebehind you will need to add x:ClassModifier="internal" to the root element in the XAML:

<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="MyNameSpace.MyUserControl"
    x:ClassModifier="internal">
       <!-- bla -->
</UserControl>