开发者

WPF: Making an element not appear as public or friend?

开发者 https://www.devze.com 2023-02-01 17:27 出处:网络
In the designer, how can I (for instance) make a button be private within the Window that 开发者_开发技巧it is on? I remember a way to do this in Windows Forms, but I don\'t know how in WPF.

In the designer, how can I (for instance) make a button be private within the Window that 开发者_开发技巧it is on? I remember a way to do this in Windows Forms, but I don't know how in WPF.

Is there a way to do it through Visual Studio?


Try using

<Button x:FieldModifier="private" />

On your object element.

This doesn't appear to be baked right into the designer where you can just edit it in the Properties Editor. You'll have to add this to the markup yourself. However, it is supported so at least you can get intellisense to help you put it there.

0

精彩评论

暂无评论...
验证码 换一张
取 消