Results 1 to 6 of 6

Thread: Printing and Parameters issues in Silverlight Beta 4

  1. #1
    Join Date
    Apr 2010
    Posts
    80

    Printing and Parameters issues in Silverlight Beta 4

    I want to troubleshoot some issues that are caused while printing in Silverlight. I am using the beta version of Silverlight 4. I have tried to do lot of things to resolve this problem but nothing worked.!! Even I googled for long time but that also didn't helped me. So thought to ask you guys, since you know much things about the Silverlight. Is there any robust code to allow more detailed print settings.?? If such code exists then please provide some sample to me. I want help about the printing and parameters issues in Silverlight Beta 4. So please help as soon as possible.

  2. #2
    Join Date
    Feb 2008
    Posts
    129

    Re: Printing and Parameters issues in Silverlight Beta 4

    To this solution will add a new Silverlight project of type Class Library to incorporate in it the print functionality, instead of having it directly in the code-behind Silverlight project MainPage.xaml. The new project will put you SL4.Demo.Print.Util name and add two classes and Parameters.cs Print.cs. I think that you should have got an idea about this.

  3. #3
    Join Date
    Oct 2008
    Posts
    180

    Re: Printing and Parameters issues in Silverlight Beta 4

    I would like to discuss about the print.cs. It is in this class where we will implement the printing code. This class will have a public method Print () which will serve as a click event handler of the button wherever you want to invoke the functionality (in MainPage.xaml button2 button). Thus we are handling the click event on an instance of impressions rather than directly in code-behind. Print class is a generic type, because we need to know in advance the type of content that is sent to print in order to perform filtering records properly. In our example is an object of type Rocket.

  4. #4
    Join Date
    Feb 2008
    Posts
    180

    Re: Printing and Parameters issues in Silverlight Beta 4

    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.

  5. #5
    Join Date
    Jan 2009
    Posts
    150

    Re: Printing and Parameters issues in Silverlight Beta 4

    In the class constructor Print send the required parameters which are the source of data, the DataTemplate that will be used to define the distribution of elements, each line will have high (corresponding to the top of the record with the Grid's DataTemplate ), the name you want to appear in the panel of the printer and the desired title. Moreover, with the following line:
    this.button2. Click + = util.Print;
    We are defining as the handler of the button's Click event public method implemented in the class Print Printing. It is in this method where we will implement the functionality to send to print our content. It is also worth noting:
    util.PrintEnded + = new PrintEnded (util_PrintEnded)

  6. #6
    Join Date
    Feb 2009
    Posts
    117

    Re: Printing and Parameters issues in Silverlight Beta 4

    You should also have an idea about the Parametros.cs. The class will serve to allow the user to modify the parameters for printing, mainly for the header and left margin for the ItemsControl. The mechanism selected for this purpose will be to have a ChildWindow (called configuration) which contains a control type DataForm; to allow editing of values is a simple and quick.

Similar Threads

  1. how to configure the printing parameters in Nokia E71
    By KaIilAshhh in forum Portable Devices
    Replies: 4
    Last Post: 29-08-2011, 11:21 AM
  2. Replies: 3
    Last Post: 17-04-2011, 04:55 PM
  3. How to do Printing in Silverlight Beta 4
    By Tweaker in forum Tips & Tweaks
    Replies: 3
    Last Post: 27-09-2010, 10:40 PM
  4. Uninstalling Silverlight 4 Beta on OSX
    By Fausty in forum Windows Software
    Replies: 3
    Last Post: 05-08-2010, 05:11 PM
  5. Silverlight 4 DataGrid is not printing properly.
    By Adrut in forum Windows Software
    Replies: 3
    Last Post: 03-08-2010, 05:15 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,286,658.06988 seconds with 17 queries