The pivotviewer control can load nearly a thousand pieces of data in a short period of time, and visualize it. In the use process, combined with the deep zoom technology, you can easily view high-resolution data content.
It's very exciting.
So let's test the effect on your own.
First, we need to collect data, which provides us with three collection methods.
1. Collect collection tool for Microsoft Excel
2. Collect collection tools for the command line
3. Sample Code for creating just in time when collections
Excel is a habit. Here we use Excel for demonstration.
After the external collection tool for Microsoft Excel is installed, you can see the add-on in Excel:
First, create a collection:
Token provides us with a standard data template
Image Location: The image address (absolute path. You only need to fill in the image address to automatically preview the image)
Preview: Image Preview
Name: Data name
Href: Link (each data record of a worker can be linked to a page)
Description: Content
Based on our needs, we can also add (Chinese is supported)
Then sort out the data
Copy to the template:
Finally, configure the output title and other information.
Then the output is as follows:
After the output, our data collection is complete.
Open vs2010 and add a silverlight4 project.
First add reference "system. Windows. program. dll" (under c: \ Program Files (x86) \ microsoft sdks \ Silverlight \ v4.0 \ Program tviewer \ jun10 \ bin)
Then add:
xmlns:pivot="clr-namespace:System.Windows.Pivot;assembly=System.Windows.Pivot"
Now we can use pivotviewer to add a pivotviewer:
<pivot:PivotViewer Name="PivotViewerControl" Grid.Column="0" ItemDoubleClicked="PivotViewerControl_ItemDoubleClicked"> </pivot:PivotViewer>
Here we define a double-click event. In the double-click event, we will pop up the link we set previously.
private void PivotViewerControl_ItemDoubleClicked(object sender, ItemEventArgs e) { PivotItem piv_item = PivotViewerControl.GetItem(e.ItemId); if (!string.IsNullOrWhiteSpace(piv_item.Href)) { PivotViewerControl.CurrentItemId = e.ItemId; HtmlPage.Window.Navigate(new Uri(piv_item.Href, UriKind.RelativeOrAbsolute), "NewPage"); } else { MessageBox.Show("No Web Page..."); } }
Don't forget.
using System.Windows.Pivot;
Of course, in the end, we can't forget the key one. We haven't specified javastviewer to the data we just collected (I put it under the root directory of the site)
public MainPage() { InitializeComponent(); PivotViewerControl.LoadCollection("http://127.0.0.1/New Collection1.cxml", " "); }
Compile and run the program to see the effect.
Why not display it...
We also need to add the MIME type to the web server.
. Cxml-text/XML
. DZC-text/XML
. Dzi-text/XML
Then you can see the effect:
Hmm
Let's see...
Reference: http://10rem.net/blog/2010/06/29/introducing-the-pivotviewer-control-for-silverlight
Http://www.cnblogs.com/jv9/archive/2010/06/30/1767989.html
Http://www.codeproject.com/KB/grid/PivotViewer.aspx
Http://blogs.microsoft.co.il/blogs/shair/archive/2010/07/03/silverlight-pivotviewer-the-full-guide.aspx