Control are visible in VisualStudio 2022 ToolBox even after DesignTimeVisible attribute as false.
In VS 2022, I have a Custom Control Library, When adding the Custom Control to WPF ToolBox the controls are visible even after adding the following attribute "[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), ToolboxItem(false), DesignTimeVisible(false)]". If I use the "DesignTimeVisible(false)" attribute at first "[DesignTimeVisible(false), Browsable(false), EditorBrowsable(EditorBrowsableState.Never), ToolboxItem(false)]" in this format it works.
But In VS 2019, it supports all the formats have no issues.
Is there any solution to support all formats in VS 2022?
Attached Custom Control Library sample code here.
namespace WpfCustomControlLibrary
{
[DesignTimeVisible(false), Browsable(false), EditorBrowsable(EditorBrowsableState.Never), ToolboxItem(false)]
public class CustomControl1 : Control
{
static CustomControl1()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl1), new FrameworkPropertyMetadata(typeof(CustomControl1)));
}
}
}