RichTextBox text is disappearing in VisualBrush after detaching from control on screen?

Visual brush cannot be frozen. So you can create ImageBrush from VisualBrush before detaching your control from visual tree. Here is an example how to do that: Freeze” that VisualBrush .

Up vote 2 down vote favorite share g+ share fb share tw.

I have a thumbnail preview which is done through VisualBrush. Preview is of an ItemsControl which contains along other elements RichTextBox. Var preview = new VisualBrush(itemsControl, ViewboxUnits = BrushMappingMode.

Absolute, Viewbox = Rect(controlSize), Stretch = Stretch. Uniform); When ItemsControl is a part of the Application visual tree everything the preview and the controls themselves display just fine, but when I remove ItemsControl from the Application visual tree (e.g. Canvas. Remove(itemsControl)) RichTextBox controls become invisible in the preview (VisualBrush) while all other controls are displaying as usual.

Public void SetActiveControl(ItemsControl newItemsControl) { canvas.Children. Remove(currentItemsControl); canvas.Children. Add(newItemsControl); currentItemsControl = newItemsControl; } I compared properties of RichTextBox before and after its beeing detached from Application visual tree.

The difference is in the properties IsLoaded (before TRUE, after FALSE) and IsVisible (before TRUE, after FALSE). But other elements (e.g. Path) have the same differences and still display in preview correctly. I can't grasp how doing canvas.

Remove(itemsControl) hides RichTextBox but keeps other controls! Any ideas would be greatly appreciated! C# wpf richtextbox visualbrush link|improve this question edited Apr 6 at 6:41 asked Apr 5 at 18:27Alfa0731518 78% accept rate.

Visual brush cannot be frozen. So you can create ImageBrush from VisualBrush before detaching your control from visual tree. Here is an example how to do that: “Freeze” that VisualBrush.

Freeze doesn't work on VisualBrush – Alfa07 Apr 6 at 8:11.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions