The code will MainPage.xaml.cs as follows:
Code:
public partial class MainPage: UserControl
(
SL4. Print. Print <Album> util = null;
public MainPage ()
(
InitializeComponent ();
util = new Print. Print <Album> (this. Resources ["albums"] as Albums,
this. Resources ["PrintDataTemplate"] as DataTemplate,
40.0,
"Exhibit"
"List of albums - The Beatles");
util.PrintEnded + = new EventHandler (util_PrintEnded)
this.button1. Click + = new RoutedEventHandler (button1_Click);
this.button2. Click + = util.Print;
)
void button1_Click (object sender, RoutedEventArgs e)
(
util. Setup ();
)
util_PrintEnded void (object sender, EventArgs e)
(
MessageBox. Show ("ok!");
)
)
I am sure that this sample will help you a lot.
Bookmarks