Hi
I want to save content of a RichTextBox to varbinary (= byte array) in XamlPackage format.
I need technicial advise on how to it.
I actually need to know how to convert between FlowDocument to byte array.
Is it even recommended to store it as varbinary, or this is a bad idea?
Update
Code snippet:
///Load
byte[] document = GetD...
I want to detect (preferably through an event) when any content is added, changed, etc. in a FlowDocument and when it does I want to cause a FlowDocumentScrollViewer displaying the FlowDocument to automatically scroll to the end.
...
I have a FlowDocument with much content inside. I need to get the controls that are currently in the visible area.
with
DependencyObject obj = FlowDocumentScrollViewerCtrl;
do
{
if (VisualTreeHelper.GetChildrenCount(obj) > 0)
{
obj = VisualTreeHelper.GetChild(obj as Visual, 0);
}
}
while (!(obj is ScrollViewer));
...
Dear community.
I have now used way too long time, trying to figure out a problem, which I didn't think would be that hard.
Here is the deal:
I am writing a small application using C# and WPF.
I have a RichTextBox containing a FlowDocument.
I have added a small textbox and a button below my richtextbox.
The user then types in the w...
Hi,
How can i copy the contents of one FlowDocument to another FlowDocument below is what i tryed
foreach (var blk in fd1.Blocks)
{
fd2.Blocks.Add(blk);
}
fd1 is FlowDocument1 and fd2 is FlowDocument2.
But i get the below error.
Collection was modified; enumeration operation may not execute.
Thanks
Arvind
...
What is the best way to get back the XAML/XML value of a FlowDocument?
I noticed there isn't a .Value, .Text, .Caption, .ToXml(), etc...
UDPATE:
I'd like to be able to get access to it initially to serialize to disk or database. Treat it as its own document format. Later translating it to other formats would be nice.
Also been wonder...
Hello, I am trying to achieve something like the follwing:
This is a WPF Flow Document shown to
user.
This has been generated by user Richard Richardson at 01/01/01 23:15:00.
Blah blah blah (another 466 lines)...
End of message.
I want this date and the user name and 466 (and another gazillion literal texts) to come from Bi...
I have a flowdocument with a named Span" test1" which I want to replace the contents of programmatically
TextRange tr = new TextRange(this.test1.ContentStart,this.test1.ContentEnd);
Run run = this.test1.Inlines.First() as Run;
run.Text = "replaced text";
This works, however the problem is when doing the update the name of the span...
I'm trying to get a FlowDocument to print. After spending much of the day trying multiple pages I failed and opted for something simpler, but I'm now at a loss to explain when text isn't output to the page. This has to be something I've got snowblind to I think. There are two tables below, placing a converter on both shows that the value...
I am using a FlowDocumentReader to display FlowDocuments in a .NET 3.5 WPF application (the FlowDocuments have help/info/notes that are displayed based on user choices in the ui).
I assumed that the FlowDocumentReader contents would be read/recognized by a Screen Reader (I am testing with NVDA on Windows 7) - but when the reader gets fo...
My target: a DocumentPaginator which takes a FlowDocument with a table, which splits the table to fit the pagesize and repeat the header/footer (special tagged TableRowGroups) on every page.
For splitting the table I have to know the heights of its rows.
While building the FlowDocument-table by code, the height/width of the TableRows a...
I'm using .NET 3.5
I have a FlowDocument inside a FlowDocumentScrollViewer. I am not using RichTextBox. The FlowDocument comes with a number of "freebies", including text selection and a context menu for copy/paste.
How can I find out what text is currently selected in the FlowDocument? I imagine that I could use ApplicationCommands...
Hi,
I have a WPF page used as an input form which contains a number of controls on one side, and a flow document reader on the other.
I want to set the content of this document reader to a specific part of a flow document which is loaded when the form is loaded, (via a loaded event).
I have found an article explaining how to do this,...
I'm trying to save and restore the position of the document within a FlowDocumentReader to create a bookmark feature. There doesn't appear to be any seeking or search feature build in that is publicly accessible, leaving me with the following options:
Use FlowDocumentPageViewer instead,
saving the page each time the window
is resized a...
I have written a custom Bindable RichText Box, so I can bind to the Document property.
However, as soon as I set my document content, the only keyboard input it accepts is the backspace key (???). No other keyboard input is acknowledged (including the arrow keys).
Any ideas?
Here is the code of my BindableRTB class:
Imports System.W...
I'm generating a FlowDocument in code but I want it to apply dynamic styles defined in the resource dictionary. Even though I set the key using SetResourceReference, it seems like the resource lookup doesn't occur once I add the TextElements to the FlowDocument.
My guess is that just adding the control to the document doesn't hook u...
I created the following class in order to have an easy way to display formatted text in a WPF document.
However this solution returns a FlowDocument, and I am having trouble integrating this FlowDocument in my current application in which I was simply adding TextBlocks to StackPanels and WrapPanels and Borders, etc.
How can I add the ...
Thanks to Leom's answer I was able to add a FlowDocument to a StackPanel by wrapping it in a FlowDocumentReader.
But now I have two problems:
it seems only the first FlowDocumentReader is added and the rest ignored
there is an unwanted margin that I can't get rid of
How can I add multiple FlowDocumentReaders to a StackPanel without ...
The following code in a WPF app creates a hyperlink that looks and acts like a hyperlink, but doesn't do anything when clicked.
What do I have to change so that when I click it, it opens the default browser and goes to the specified URL?
XAML:
<Window x:Class="TestLink238492.Window1"
xmlns="http://schemas.microsoft.com/winfx/200...
Various WPF applications of mine display FlowDocument's. I'm able to print them, using the approach described in the answer to Printing a WPF FlowDocument.
Now I'd like to add a "print preview" capability. In the normal case, I am printing the FlowDocument that is displayed in the Window, and so I wouldn't need a Print Preview then....