2013-03-21 33 views
1

如何在Silverlight xaml中使用PivotViewer?我读http://msdn.microsoft.com/en-us/library/system.windows.controls.pivot.pivotviewer(v=vs.95).aspx,并添加到assembly.But参考我得到一个错误如何在Silverlight xaml中使用PivotViewer?

“PivotViewer”这个名字并不在命名空间“http://schemas.microsoft.com/client/2007”的存在。

这是我的XAML:

<UserControl x:Class="SilverlightApplication2.MainPage" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="400"> 

    <Grid x:Name="LayoutRoot" Background="White"> 
     <TextBlock Text="Hello world"></TextBlock> 
     <PivotViewer/> 
    </Grid> 
</UserControl> 

回答

2

添加到装配System.Windows.Controls.Pivot然后

<UserControl x:Class="SilverlightApplication2.MainPage" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:pivot="clr-namespace:System.Windows.Controls.Pivot;assembly=System.Windows.Controls.Pivot" 
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="400"> 

    <Grid x:Name="LayoutRoot" Background="White"> 
     <TextBlock Text="Hello world"></TextBlock> 
     <pivot:PivotViewer x:Name="pViewer" /> 
    </Grid> 
</UserControl> 
1

我有我的博客,走通使用PivotViewer一个系列。这应该让你开始。 http://tonychampion.net/blog/index.php/series/pivotviewer-basics/

+0

由于托尼的参考。我试着按照你的第一个教程,但我得到的错误,如“在Silverlight项目中不支持PivotViewer”和“名称空间前缀”pivot“未定义。 – 2013-03-22 09:47:04

相关问题