简体   繁体   English

拖动控件时,如何在xaml中具有自定义控件的属性?

[英]How to have properties of custom control in xaml when we drag that control?

I have created a custom control for TextBox with soem DependencyProperties and some simple properties, now, when I drag my custom control from ToolBox to designer then I want to have properties which are declared in custom control to appear in XAML by default. 我为带有文本DependencyProperties Properties和一些简单属性的TextBox创建了一个自定义控件,现在,当我将自定义控件从ToolBox拖到设计器时,我希望具有在自定义控件中声明的属性以默认出现在XAML中。

Does anyone have idea about it? 有人知道吗?

Looking forward for quick reply. 期待快速回复。

Samir 萨米尔

We can add the properties to the control by default while you are dragging from ToolBox to the designer.. 从工具箱拖到设计器时,默认情况下,我们可以将属性添加到控件中。

Please refer the below msdn documentation.. 请参考下面的msdn文档。

http://msdn.microsoft.com/en-us/library/bb907306(v=vs.90).aspx http://msdn.microsoft.com/zh-CN/library/bb907306(v=vs.90).aspx

i think it will help you to resolve the problem.. 我认为这将帮助您解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM