如何从ScrollViewer编辑器控件中获取数据 [英] How to get data from the ScrollViewer Editor Control
问题描述
<ScrollViewer x:Name="scrollViwer" FocusVisualStyle="{x:Null}" Focusable="True" ScrollChanged="scrollViwer_ScrollChanged" HorizontalScrollBarVisibility="Auto">
<local:EditorControl Background="Transparent" x:Name="editor" Focusable="True" FocusVisualStyle="{x:Null}"></local:EditorControl>
</ScrollViewer>
这是xml代码
在后端,我正在使用c#.当我写
at the backend i am using c#. when i write
editor.ConsumeText(这是一个字符串");
editor.ConsumeText("Hi This is a string");
然后这是一个字符串"被写入编辑器.但是我想得到文字 来自编辑器,并希望将其保存为字符串.
Then "Hi this is a string" is written to the editor. But I want to get text From the editor and want to save it in a string.
请帮助
谢谢
推荐答案
Yousafzai,
Hi Yousafzai,
这不是ScrollViewer的问题.它与ScrollViewer完全无关. :-)
that's not a problem of the ScrollViewer. It has nothing to do with the ScrollViewer at all. :-)
EditorControl是项目的UserControl/自定义控件(位于本地名称空间中).因此,您需要检查是否存在通过"editor.Something"获取字符串的方法或属性.或不.如果没有,则需要创建这样的成员 在EditorControl上.
The EditorControl is a UserControl/Custom Control of your project (it's in the local-namespace). So you need to check wether there is a method or property to get the string via "editor.Something" or not. If not, you need to create such a member on the EditorControl.
这篇关于如何从ScrollViewer编辑器控件中获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!