views:

18

answers:

0

Our application has a number of objects on a canvas; the canvas is contained in a scroll viewer. We also have a slider control and some buttons, always centered at the top of the window.
I am trying to print the application by capturing a bitmap of the app, but without any 'decorations' -- slider, buttons, or scroll bars.

        _scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;
        _scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden;
        var s = xSlider;
        s.Visibility = Visibility.Collapsed;
        var b = xPlusButton;
        b.Visibility = Visibility.Collapsed;
        b = xMinusButton;
        b.Visibility = Visibility.Collapsed;

        b = xButton;
        b.Visibility = Visibility.Collapsed;

The slider and buttons are hidden, as expected, but the scrollbars are not.
I suspect the application needs to redraw the layout in order to hide the scrollbars. Is there a way to make that happen? This is made more complicated by the fact that the print operation in SL 4 must be initiated by a UI gesture; there is no way (AFAIK) to initiate programatically, so this redraw must happen in one of the PrintDocument event handlers.

Thanks for any suggestions....