Serialize WPF User Control

I have a user control which used to display data using a number of text blocks on a canvas. My intention is to be able to take all of the underlying properties from each text block (IE the top and left corners, height, width...) so I can draw them to a bitmap for printing. What would be the best approach for this? I was thinking of trying serialize the user control but I am not sure if that is the best approach. Also, I was wondering about trying to use the visual and logical trees to get the appropriate data.

-------------Problems Reply------------

May be you will find useful XamlWriter . It allows to serialize WPF control (and any other class) to XAML.

Category:wpf Views:2 Time:2010-07-09

Related post

  • How can I serialize wpf user control with xaml and code behind 2011-08-03

    I want to serialize wpf user control xaml and codebehind. XamlWriter.Save() only serialize's xaml so what can I do in this situation? My situtation is I have a usercontrol which include custom methods, subscribed events (ex: button click) When I dese

  • What are some good WPF grid controls? 2008-09-27

    We use a grid control from Infragistics at work. Are there others? Pay or free? --------------Solutions------------- I'd second Telerik, which is what MS used for office, IIRC. I don't know if they have gone WPF though, but they have a good track rec

  • Is it possible to define a property on a WPF user control is required? 2008-10-10

    When creating a WPF user control, is it possible to make a property required via an attribute or other mechanism? --------------Solutions------------- Assign the property to an initial value which can be distinguished from any other value that it mig

  • WPF User Control Parent 2008-11-19

    I have a user control that I load into a main window at runtime. I cannot get a handle on the containing window from the user control. I have tried this.Parent, but it's always null. Does anyone know how to get a handle to the containing window from

  • Localizing a WinForms Application with Embedded WPF User Controls 2008-12-17

    The application I'm trying to localize is a WinForms application that has a few hosted WPF user controls (WPF user controls hosted in an ElementHost WinForms control). I use resx files to localize the WinForms, which VS2008 manages quite well. The pr

  • Convert WPF (XAML) Control to XPS Document 2009-02-02

    Can I take an Existing WPF (XAML) Control, databind it and turn it into an XPS document that can be displayed and printed using the WPF XPS Document Viewer? If so, how? If not, how should I be doing ‘reporting’ in WPF using XPS/PDF/etc? Basically I w

  • Disposing WPF User Controls 2009-02-02

    I have created a custom WPF user control which is intended to be used by a third party. My control has a private member which is disposable, and I would like to ensure that its dispose method will always get called once the containing window/applicat

  • SWF in WPF WebBrowser control - Auto accept camera/microphone access? 2009-02-16

    I have an application with a WPF WebBrowser control which displays a Flash file. The flash file is used for WebCam/Microphone chat. At the moment, everytime the flash is loaded it displays a dialog box asking for permission to use the microphone and

  • How to create trapezoid tabs in WPF tab control 2009-02-18

    How to create trapezoid tabs in WPF tab control? I'd like to create non rectangular tabs that look like tabs in Google Chrome or like tabs in code editor of VS 2008. Can it be done with WPF styles or it must be drawn in code? Is there any example of

  • Expose multiple command in WPF user control 2009-02-19

    A better explanation, I hope: I have a toolbar with 3 buttons on it, all three bound to a Command (including a CommandParameter) this toolbar is used on several screens the xaml of the toolbar is exactly the same over all those screens I want to remo

  • How do I scroll text in WPF textBlock control? 2009-03-21

    HI I am new to WPF and I am looking for a solution to scroll text in a WPF application, I tried some animation but I have a clipping problem I found a possible solution to my problem in the following place:

  • Hiding the Arrows for the WPF Expander Control 2009-07-01

    When using the WPF Expander control it is displayed with the default "Up" and "Down" arrow keys. Is there any way to hide those up and down arrows? UPDATE: I managed to remove the arrows by creating a ControlTemplate but now the expanding ability is

  • Data-Binding a WPF DataGrid Control to a System.Data.DataTable Object? 2009-07-10

    What do I need to do to get my WPF DataGrid control to bind to a DataTable object? I've been suffering over this for several days now. Even when the binding and the query both work correctly, and there is observable data in the table - nothing shows

  • WPF UI control vendors - ActiPro, Telerik, Xceed, Infragistics, DevExpress and others 2009-07-19

    I have to choose a commercial WPF UI control library for our project. Browsing the web I have found these major vendors: Actipro: Telerik:

  • What is the best WPF Graphing control? 2009-07-25

    Our latest project is using WPF for a rich client and we need a graphing tool that makes the best looking graphs that also has the ability to do the following with the graph: Line Graphs with the ability to add data points Hot spots on the graph that

  • How do I suppress script errors when using the WPF WebBrowser control? 2009-08-19

    I have a WPF application that uses the WPF WebBrowser control to display interesting web pages to our developers on a flatscreen display (like a news feed). The trouble is that I occasionally get a HTML script error that pops up a nasty IE error mess

  • Send keys to WPF Browser control 2009-08-25

    Can I programatically send [UserID]{TAB}[Password]{CARRIAGE RETURN} to a webbrowser control which has a userID, password and Sign-in button there. I wanted to use my own virtual keyboard in my application. Any tips here? --------------Solutions------

  • How to combine imported and local resources in WPF user control 2009-08-26

    I'm writing several WPF user controls that need both shared and individual resources. I have figured out the syntax for loading resources from a separate resource file: <UserControl.Resources> <ResourceDictionary Source="ViewResources.xaml"

  • wpf user control base class problem 2009-10-01

    I am new to WPF and have created a WPF User Control Library I added a Base class that looks like this public class TControl : UserControl { } and want all of my controls to inherit from it. I have a Control called Notification which looks like public

Copyright (C), All Rights Reserved.

processed in 0.128 (s). 11 q(s)