Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1099207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:41:56+00:00 2026-05-17T00:41:56+00:00

I’m trying to convert XAML control to XPS document, but i’d like to do

  • 0

I’m trying to convert XAML control to XPS document, but i’d like to do this in batch mode – render control in memory and print it to XPS without rendering it on the screen. This project should work even without GUI.

I’ve read Related topic on stackoverflow, but it’s not working properly. I can create control, set DataContext, but output xps is empty. If i render control on the screen and then print it, everything is ok, but if i’d like to do this in batch mode, i got empty document (there was only static labels etc.)

How can i force control to bind controls with data?

Next hard part would be: how can i add my custom header on each page if i print long-multi-page control? (ex. list?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:41:57+00:00Added an answer on May 17, 2026 at 12:41 am

    I’m skipping your second question as it is complex enough to be a standalone.

    I faced the same issue, but it may be caused by a couple of different things.

    If the issue is because the bindings haven’t been “tripped” yet, the solution is slightly hacky but is easy to do if you control the DataContext type. You just add a public or internal method to your type that allows you to fire off PropertyChanged events for each public property. Here’s an example:

    public interface IForceBinding : INotifyPropertyChanged
    {
      void ForceBindings();
    }
    
    public class MyDataContext : IForceBinding
    {
      public event PropertyChanged;
      private string _text;
      public string Text
      {
        get{return _text;}
        set{_text = value; OnPropertyChanged("Text");}
      }
      public void ForceBindings()
      {
        OnPropertyChanged("Text");
      }
    
      private void OnPropertyChanged(string propertyName)
      { 
        // you know the drill
      }
    }
    

    then, you can use it thusly:

    public void Print(MyDataContext preconfiguredContext){
      var page = new MyWpfPage();
      page.DataContext = preconfiguredContext;
      preconfiguredContext.ForceBindings();
      // write to xps
    

    If that isn’t working, you might be encountering a bug where the bindings on the first page never show up. I’d have to dig for awhile before I can re-find the solution to that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.