10/17/08

Permalink 11:57:48 am, Categories: WPF

Framework Update Alert!

In a previous post, I showed a good way to do alternating row styles in a ListBox.

I recently discovered that .NET 3.5 SP1 adds extended framework support for doing this.

If you are fortunate enough to be developing with the bleeding edge (3.5 SP1), see this MSDN page for an example and documentation of the new framework support.

Permalink 08:55:30 am, Categories: News

I'd just like to take a moment to welcome questions! Feel free to use my contact page to send me suggestions for articles you'd like to see about C#, WPF or .NET in general.

Please use the comments form for topical feedback on specific articles.

10/14/08

Permalink 12:29:55 pm, Categories: WPF

Background

In WPF, there are often many ways of accomplishing the same end result. I recommend always looking for the most "correct" solution, and that in my opinion is the one that most naturally fits in with the framework hooks already provided, as well as being the most generic and reusable solution possible.

The Problem

Simple. How do I implement alternating row styles in a ListBox?

Building Blocks

The following, provided in the framework, will be useful:

Read more »

09/29/08

Permalink 02:05:41 pm, Categories: WPF

More Than Meets the Eye

You may have glossed over the following code in my previous post:

        PrintTicket ticket = new PrintTicket();
        ticket.PageOrientation = PageOrientation.Portrait;
        ticket.CopyCount = copies;
 
        PrintCapabilities capabilities = queue.GetPrintCapabilities(ticket);
 
        ...
 
        writer.WriteAsync(documentPaginator, ticket);

And I couldn't blame you for it. On the surface it doesn't appear all that significant or interesting.

But the reason behind creating and using a custom PrintTicket goes beyond setting the number of copies for the print job.

Read more »

09/23/08

Permalink 12:35:56 pm, Categories: WPF

Background

FlowDocument objects are a great way to present information with flexible layout options. WPF provides several viewer controls to easily visualize FlowDocument instances in a UI. One of the big benefits of the viewers is that they format and paginate everything automatically, not only for the display area but also for printing. This makes it a snap to generate dynamic documents (e.g., receipts in an ordering system), display them on the screen, and print them with correct layout and pagination.

The Problem

The problem is that the viewer controls (FlowDocumentReader, FlowDocumentPageViewer and FlowDocumentScrollViewer) each offer a single public entry point for printing, such as Print, that offers only the default Windows printing behavior. This means the old ugly Windows Print Dialog pops up. You cannot automate printing in any way using this approach.

Read more »

:: Next >>

May 2012
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Development miscellany of interest. To some people. Or maybe just one person. Or maybe nobody.

Search

XML Feeds

powered by b2evolution