9-11: Chart XAML in VS .NET

Drawing QR-Code in VS .NET 9-11: Chart XAML
Listing 9-11: Chart XAML
Create QR In Visual Studio .NET
Using Barcode encoder for .NET framework Control to generate, create QR Code image in VS .NET applications.
    
QR-Code Scanner In .NET
Using Barcode reader for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications.
 
Drawing Bar Code In .NET
Using Barcode creator for .NET Control to generate, create bar code image in .NET applications.
      
Scanning Barcode In VS .NET
Using Barcode reader for .NET Control to read, scan read, scan image in VS .NET applications.
Put your cursor on the line <chartingToolkit:PieSeries/> to bring up the Properties window for the PieSeries control In the Properties window click the icon to sort the properties by category Table 9-2 shows the values we need to assign to corresponding properties in the Properties window The most important ones are DependentValuePath, IndependentValuePath, and ItemBinding because those values tell the PieSeries control that the data for the chart will come from our code Figure 9-35 shows the designer once the settings in Table 9-2 are set
QR Encoder In Visual C#
Using Barcode generator for Visual Studio .NET Control to generate, create QR Code JIS X 0510 image in VS .NET applications.
Figure 9-35: XAML designer showing the design view of the PieChart
QR-Code Drawer In .NET
Using Barcode maker for ASP.NET Control to generate, create QR-Code image in ASP.NET applications.
Creating a Silverlight Web Part
Encode QR Code In VB.NET
Using Barcode generator for .NET Control to generate, create QR-Code image in .NET applications.
TABLE 9-2: Properties and Values for the PieSeries Control
Data Matrix 2d Barcode Maker In Visual Studio .NET
Using Barcode creation for Visual Studio .NET Control to generate, create DataMatrix image in .NET applications.
Property DependentValuePath AnimationSequence IndependentValuePath IsSelectionEnabled ItemBinding
Create European Article Number 13 In .NET Framework
Using Barcode maker for VS .NET Control to generate, create EAN 13 image in .NET applications.
Value TaskCount We will use the TaskCount property of the TaskGroup class as the dependent value FirstToLast This will add the pie segments in order from first to last TaskState We will use the TaskState property of the TaskGroup class as the independent value Checked Provides a nice animation when hovering the mouse over the pie chart Binding Click on the little icon in the ItemBinding cell and select Apply DataBinding in the context menu A menu dialog will pop up that you can close
Make Bar Code In .NET
Using Barcode encoder for VS .NET Control to generate, create bar code image in .NET framework applications.
With the UI designed we can go ahead and implement the code to get a list of TaskGroup objects set up Listing 9-12 shows the code for the MainPage class Remember this is the code-behind class for the MainPagexaml file You can think of it as being similar to the code-behind file for an ASPX file It will run when the Silverlight application executes
Code 39 Full ASCII Creator In .NET
Using Barcode creator for Visual Studio .NET Control to generate, create Code 3/9 image in .NET framework applications.
Listing 9-12: MainPagexamlcs
British Royal Mail 4-State Customer Code Printer In Visual Studio .NET
Using Barcode creation for .NET framework Control to generate, create British Royal Mail 4-State Customer Code image in Visual Studio .NET applications.
                 
Read Bar Code In .NET Framework
Using Barcode reader for VS .NET Control to read, scan read, scan image in .NET applications.
 
Barcode Drawer In Java
Using Barcode creation for Java Control to generate, create barcode image in Java applications.
 
Create Code 39 In .NET Framework
Using Barcode printer for ASP.NET Control to generate, create Code39 image in ASP.NET applications.

GTIN - 128 Printer In Visual Studio .NET
Using Barcode printer for ASP.NET Control to generate, create USS-128 image in ASP.NET applications.

Scanning Bar Code In Java
Using Barcode scanner for Java Control to read, scan read, scan image in Java applications.
9: SharePoint Web Parts
Making ECC200 In VS .NET
Using Barcode printer for ASP.NET Control to generate, create ECC200 image in ASP.NET applications.
   
EAN-13 Encoder In Visual Studio .NET
Using Barcode encoder for ASP.NET Control to generate, create EAN13 image in ASP.NET applications.
                         
Barcode Generation In VS .NET
Using Barcode encoder for ASP.NET Control to generate, create barcode image in ASP.NET applications.
                      
                    
                      
                    
                
  
 


Creating a Silverlight Web Part
      
 
      
   
  
    
    
Because the Silverlight PieChart is reusing the code from our previous web part we don t need to walk through it to understand how the code works and we can focus on the differences instead We are now using the objects provided by the Silverlight client object model, meaning we are now using ListItemCollection instead of SPListItemCollection from the server object model We also add code to create an ObservableCollection of TaskGroup ObservableCollection can provide notification if an item is added to the collection and trigger a refresh of the pie chart To keep the code sample smaller our code hasn t implemented such a notification event The client object model objects are used to retrieve the task list items in the GetTaskGroups method Please see 4, SharePoint Lists, for more information on how to use the client object model to retrieve data from SharePoint lists The biggest difference from the previous web part implementation is that we now have to use the ExecuteQueryAsync method on the context object because all queries using the SharePoint Silverlight client object model need to be asynchronous The ExecuteQueryAsync method takes two delegates as parameters: ClientRequestSucceeded and ClientRequestFailed
9: SharePoint Web Parts
So let s have a look at the ClientRequestSucceeded and ClientRequestFailed delegates In case the query request fails the handler ClientRequestFailed is called and a message box with a detailed error message is shown to the user If the request is successful the ClientRequestSucceeded event fires and we add new TaskGroup objects containing the status and the task count to the taskgroupList In the last line  we call back to the UI thread using the Dispatcher object of the thread that created the UI by calling BeginInvoke method Simply said, the Silverlight application creates a UI thread then calls the query asynchronously on another thread created to run the query After we have received the results we need to update the UI, which means we need to delegate the control back to the UI thread This always needs to be done if changes to the UI are made through the SharePoint Silverlight object model Once the UI thread has control again, the BindDataToChart method is executed As the name implies, this method binds the collection of TaskGroup objects to the chart control
Deploying a Silverlight Web Part to SharePoint Let s build the project TaskGroupsPieChart This creates an XAP file that will be used by the SharePoint Silverlight web part