开发者

TextBox with ControlTemplate - problem with property Text

I ha开发者_如何学JAVAve one big problem with passing value from a ControlTemplate to the control. TextBox has a ControlTemplate, how can I pass value from this template to the TextBox text?


All you need is a container with the name PART_ContentHost.

Here's the complete example on how to create a control template for a textbox: TextBox Styles and Templates. In this case the textbox is presented inside a ScrollViewer.

Hope it helps!


If I truly understand your problem, you want to Show Text Value of Textbox in custom Textbox Control. So for doing this, you must use Template-Bindingin template Like :

<CustomControl Text="{TemplateBinding Text}">

CustomControl refer to any control you use in Template.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜