mvvm - WPF Printing multiple pages from a single View Model -
i little bit troubled following problem. have user interface shows graphic (a canvas made of lines, circles, ... these wpf objects). depending on selection user makes in menu, items deleted , added. basic image looks same, few modifications made.
the user has possibility select - - 10 different "pages" clicking next/previous button.
i using mvvm light , viewmodel contains items of graphic (all lines, ...).
now print graphic multiple pages. first page should contain graphic changes page 1, second page contains graphic changes page 2 , on. actual number of pages dynamic. track property currentpage , property pagestotal. whenever push "next" button, causes command executed change variable currentpage , makes sure correct items displayed.
now print i'm stuck. dont' mind leaving mvvm zone , doing dirty work in code-behind refuse draw again in old gdi days.
any ideas welcome.
create usercontrol containing display logic (you graphic, instance). grab viewmodel list , project in usercontrols, setting each viewmodel each usercontrol's datacontext. force each 1 render calling measure infinite value , arrange resulting desiredheight , width. follow procedures print wpf visuals (link link link).
Comments
Post a Comment