问题标签 [inlineuicontainer]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
wpf - WPF Richtexbox inlineucontainer在移动时消失
在我的 WPF 应用程序中,我有一个 RichTextBox。我可以使用以下代码添加一个简单的控件,例如 TextBlock:
当我尝试在 RichTextBox 周围移动相同的控件时,我的问题就出现了。它只是简单地消失了,只留下一个空格字符。我将 AllowDrop 和 IsDocumentEnabled 属性设置为 true。我在整个网络上进行了搜索,但找不到关于为什么会发生这种情况的明确解释。谁能解释并帮助我解决这个问题?
谢谢
c# - 从 WPF RichTextBox 中删除 InlineUIContainer
我有一个带有 InlineUIContainer 的 RTB。我将它们存储在一个列表中,因此我可以直接访问它们。如何在 C# 中从我的 RTB 中删除它们?
代码示例:
wpf - FlowDocument with InlineUIContainer (image, datagrid) issues when creating XPS
I'm trying to save a FlowDocument as a XPS. I'm using .Net 4.0. The FlowDocument contains the following elements:
Everything works just fine when I display that FlowDocument within my WPF app.
Now, I need to convert this into a XPS file on a server (I'd like to print in batch!).
So I'm using the following code:
And guess what? 1) The image is missing 2) The DataGrid's empty, although the lines are drawn => Only the Run is displayed properly
I tried all sorts of combinations found on the web, but it just never comes out propertly. And any non automated solution is just so out of the question!!!
I can't wait for someone to rescue me!!! Thanks in advance
c# - RichTextBox 中的 InlineUIContainer 删除事件
InlineUIContainer
有没有办法在 a 中删除 a时收到通知RichTextBox
?目前我正在使用该Unload
事件,这是一个问题,因为当我在选项卡之间切换时也会调用该事件。
我的代码:
创建InlineUIContainer
:
该事件不应在切换选项卡时触发:
c# - 需要解决编程错误“无法序列化非公共类型 MS.Internal.NamedObject”的建议吗?
保存 wpf RichtextBox 内容时出错;并且在使用新内容重新创建之前在线删除包含按钮的 InlineUIContainer。只要按钮的内容未被修改,保存操作就可以正常工作。修改内容的行很简单;
_btnBookmark
当内联获得焦点并已验证所有属性均符合预期时,该按钮将被捕获。内容更新没有错误,新内容符合预期。
用按钮删除内联的行很简单;
inlineUIContainter 变量 iuic 有效并按预期包含子按钮。
我看不到任何方法来更改我的代码以防止这些错误。这个应用程序是在 VS2010 中启动的,我相信这些代码行当时可以工作。我最近升级到VS2015社区版,出现了这些错误。
c# - 如何从 WPF 中的可视化树中分离
我正在尝试UIElement
从 anInlineUIContainer
中正确删除 a 以便在另一个面板中使用它,但程序不断崩溃,并显示此消息“指定的视觉对象已经是另一个视觉对象的子对象或 CompositionTarget 的根。”。
我创建了一个小应用程序来说明我的痛苦。在这个程序中,一旦 Randy 按钮被他的女朋友杀死\删除,他仍然没有脱离他的父母,我发现他是UIElementIsland
. 然后任何尝试将 Randy 添加为其他任何东西的孩子都会使应用程序崩溃(天启按钮证明了我的观点 :))。您可以在删除 Randy 之前/之后单击查看 Randy 的父母,以注意到他UIElementIsland
小时候一直处于以下状态,如果他是分离的,整个问题\应该避免天启。
这是一个有趣的应用程序,所以即使只是为了好玩也可以复制和编译!任何帮助\想法将不胜感激!
C#部分:
XAML:
整个代码应该比这更短,但我对其进行了调味以使其有点有趣。希望我能照亮某人的一天。但是,请帮助我:)。
答案:
从 Randy's 派生InlineUIContainer
如下:
现在你可以正确地杀死 Randy,并将他添加到 UIElement 天堂(The StackPanel
):
谢谢大家。
c# - 删除 InlineUIContainer 时出现 System.StackOverflowException
所以,我有一个 RichTextBox,它可以包含一个或多个 InlineUIContainer,其中包含一个小的 UserControl。当其中一个被删除时,直接抛出 StackOverflowException (我的代码没有在 Backspace 按下和异常之间运行)。
内部代码中引发了异常,感谢 WinDbg,我设法恢复了 StackTrace,这是结果的重要部分:
然后再调用 MarkupWriter.RecordNamespaces 13000 次,直到出现异常。我做了一些研究,当 InlineUIContainer 被删除时,框架会尝试将其序列化为 XAML,以便能够执行撤消命令。但在这种情况下,序列化在 MarkupWriter.RecordNamespaces 调用上循环。
因为它是内部代码,我不知道如何防止这个循环。我想到的是完全阻止这个 InlineUIContainer 的序列化,但我还没有找到这样做的方法。
有吗?
编辑 :
根据要求,这里是 RichTextBox 和 UserControl 的定义。
CurveFormulaTextBox.xaml
CurveFormulaTextBox.xaml.cs
关键字组合框.xaml
关键字组合框.xaml.cs
注释中提供的第一个解决方案(自 (?) 以来已消失)是通过将 RichTextBox 的 UndoLimit 设置为 0 来完全阻止 Undo 命令。它有效地防止了删除 InlineUIContainer 时的异常。如果没有其他解决方案,我将使用此解决方案。