Textbox Templete实时文本出价问题 [英] Textbox Templete Realtime Text Bidning Issue

查看:62
本文介绍了Textbox Templete实时文本出价问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在XAML中为我的应用程序创建一个文本框控件模板。我正在使用:

< ControlTemplate x:Key =" TextBoxBoarded"的TargetType = QUOT;文本框"> 
< Grid Background ="#FFE4E4E4" CornerRadius = << 5">
< Grid Horizo​​ntalAlignment =" Left"宽度= QUOT; 139">
< TextBlock Horizo​​ntalAlignment =" Left"余量= QUOT; 10,0,0,0" TextWrapping = QUOT;包覆与QUOT; Text =" {TemplateBinding PlaceholderText}" VerticalAlignment = QUOT;中心" FontWeight =" {TemplateBinding FontWeight}"前景= QUOT;#FF4B4B4B" />
< / Grid>
< TextBox x:Name =" PART_ContentHost"余量= QUOT; 144,5,5,5" TextWrapping = QUOT;包覆与QUOT; BorderBrush = QUOT; {X:空}"了borderThickness = QUOT; 0" PlaceholderText =" {TemplateBinding PlaceholderText}" TextReadingOrder = QUOT; DetectFromContent" Text =" {TemplateBinding Text}" />
< / Grid>
< / ControlTemplate>

问题在于,当我有 Text =" {TemplateBinding Text}" 时我运行应用程序指示器(闪烁垂直线显示您在文本编辑中的位置)只是停留在文本框的开头,文本
显示在它之后,以便您无法从文本框中删除任何内容。


在应用程序运行时的实时情况看起来就像你在键入文本时一样......作为指示符(Cusror)总是停留在文本框的开头,当我在文本中间单击时,它可能看起来像文本|框,当我开始键入
它回到文本框的开头并且看起来像| TextBox然后添加我最后输入的内容,真让我感到困惑 


有人知道为什么吗?这只是我在这里遗漏了什么吗?

解决方案



你好Reece Smith Ward,


根据你的描述/代码片段,我无法重现你的问题。


所以,我建议你可以将你的演示上传到OneDrive(包括你的测试材料)。我们可以下载它并进行调试。这有助于我们快速分析您的问题。

分享OneDrive文件和文件夹:

https://support.office.com/en-us/article/Share-OneDrive-files-and-folders-9fcc2f7d -de0c-4cec-93b0-a82024800c07


最好的问候,


Yohann Lu



I am trying to create a textbox control template for my application in XAML. I am using:

<ControlTemplate x:Key="TextBoxBoarded" TargetType="TextBox">
<Grid Background="#FFE4E4E4" CornerRadius="5">
<Grid HorizontalAlignment="Left" Width="139">
<TextBlock HorizontalAlignment="Left" Margin="10,0,0,0" TextWrapping="Wrap" Text="{TemplateBinding PlaceholderText}" VerticalAlignment="Center" FontWeight="{TemplateBinding FontWeight}" Foreground="#FF4B4B4B"/>
</Grid>
<TextBox x:Name="PART_ContentHost" Margin="144,5,5,5" TextWrapping="Wrap" BorderBrush="{x:Null}" BorderThickness="0" PlaceholderText="{TemplateBinding PlaceholderText}" TextReadingOrder="DetectFromContent" Text="{TemplateBinding Text}"/>
            </Grid>
        </ControlTemplate>

The problem is that, where I have the Text="{TemplateBinding Text}" when I run the application the indicator (Flashing Vertical line that shows where you are in text editing) just stays at the start of the textbox and the text shows up after it making it so that you cannot delete anything from the textbox.

In real time when the Application is running is look like the when your typing |Text here.... | being the indicator(Cusror) always stays at the start of the textbox when I click in the middle of the text do it may look like Text|Box when I start typing it goes back to the start of the text box and looks like |TextBox and then adds what I'm typing on the end, really confusing me  

Does Anyone know why? Is it just me missing something here?

解决方案


Hi Reece Smith Ward,

According to your description/code snippets, I can not reproduce your problem.

So, I suggest you can upload your demo to OneDrive(Including your test material). We can download it and debugging. This will help us quickly analyze your problem.
Share OneDrive files and folders:
https://support.office.com/en-us/article/Share-OneDrive-files-and-folders-9fcc2f7d-de0c-4cec-93b0-a82024800c07

Best Regards,

Yohann Lu


这篇关于Textbox Templete实时文本出价问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆