Beispiel #1
0
 // -------------------------- AsyncPrintEvent -------------------------
 /// <summary>
 ///   Called as the asynchronous save proceeds.</summary>
 /// <param name="saveHelper"></param>
 /// <param name="asyncInformation">
 ///   Progress information about the asynchronous save.</param>
 private void AsyncPrintEvent(object printHelper, AsyncPrintEventArgs asyncInformation)
 {
     if (asyncInformation.Completed)
     {
         this.mainCanvas.Background = (Brush)App.Current.FindResource("canvasBrushResource");
         MessageBox.Show("标签打印完成", "打印完成");
     }
 }
Beispiel #2
0
        // -------------------------- AsyncPrintEvent -------------------------
        /// <summary>
        ///   Called as the asynchronous save proceeds.</summary>
        /// <param name="saveHelper"></param>
        /// <param name="asyncInformation">
        ///   Progress information about the asynchronous save.</param>
        private void AsyncPrintEvent(
            object printHelper, AsyncPrintEventArgs asyncInformation)
        {
            if (asyncInformation.Completed)
            {
                AsyncPrintStatus.Text    = asyncInformation.Status;
                AsyncPrintProgress.Value = 100;

                MessageBox.Show(asyncInformation.Status, "Completed");

                //Hide async controls
                AsyncPrintLabel.Visibility    = Visibility.Hidden;
                AsyncPrintProgress.Visibility = Visibility.Hidden;
                AsyncPrintStatus.Visibility   = Visibility.Hidden;

                //Enabled print buttons, and disable the cancel button
                UIEnabled(true, true, false);
            }
            else
            {
                AsyncPrintStatus.Text     = asyncInformation.Status;
                AsyncPrintProgress.Value += 5;
            }
        }// end:AsyncPrintEvent()