【问题标题】:How to use PivotViewer in Silverlight xaml?如何在 Silverlight xaml 中使用 PivotViewer?
【发布时间】:2013-03-21 10:23:39
【问题描述】:

如何在 Silverlight xaml 中使用 PivotViewer?我阅读了http://msdn.microsoft.com/en-us/library/system.windows.controls.pivot.pivotviewer(v=vs.95).aspx 并添加了对程序集的引用。但是我收到了一个错误

名称空间“http://schemas.microsoft.com/client/2007”中不存在名称“PivotViewer”。

这是我的 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>

【问题讨论】:

    标签: silverlight xaml pivotviewer


    【解决方案1】:

    然后添加了对程序集 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>
    

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      • 谢谢托尼。我尝试按照您的第一个教程进行操作,但出现 PivotViewer is not supported in a Silverlight projectThe namespace prefix "pivot" is not defined. 等错误
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多