I have a need to display a certain WPF control only in the [VS 2017] designer, but not during run time. (Specifically, a background image to lay out the components).
As I learned, the opposite effect (hiding a control at design time) can be achieved using the undocumented d:IsHidden="true"
attribute, from the namespaces that are typically included even by default:
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
There is another feature to have a design-time style with d:DesignStyle
.
But I couldn't find anything like d:Visible
or something to the effect.
So, are there any simple methods to have a design-time-only component, similar to having a special 'd' attribute? I'd prefer not to use a custom code-behind, because there is at least a trivial (but annoying) solution: just comment out the component before compilation!
Ideally, the whole component should be disabled/removed at run time, so that it didn't take any resources.
More generally, is there a way to find all these 'undocumented' features of the d
namespace?