c# - 如何在 UWP 中创建 Tab Header Pivot 控件?

标签 c# header pivot windows-10-universal uwp-xaml

我想在我的应用程序中使用自定义的 Pivot 控件。我需要它与我在警报应用程序中看到的完全一样,我从中添加了屏幕截图,如下所示:

customized pivot control

  • 我想要带有图标和文本的标签
  • 每个选项卡在被选中时都应该改变颜色

我将如何实现这一点?

Fullscreen screenshot of the alarm app

最佳答案

基本上,您应该为此使用标准的枢轴控件——但不要将文本放入您自己的用户控件或分组到标题内容中。

<Pivot Style="{StaticResource TabsStylePivotStyle}">
    <PivotItem>
        <PivotItem.Header>
            <local:TabHeader Label="item 1" Glyph="&#xE719;" />
        </PivotItem.Header>
        <TextBlock Text="Content content content" />
    </PivotItem>
    <PivotItem>
        <PivotItem.Header>
            <local:TabHeader Label="item 2" Glyph="&#xE721;" />
        </PivotItem.Header>
        <TextBlock Text="Content content content" />
   </PivotItem>
   <PivotItem>
       <PivotItem.Header>
           <local:TabHeader Label="item 3" Glyph="&#xE723;" />
       </PivotItem.Header>
       <TextBlock Text="Content content content" />
   </PivotItem>

这里是 an official code sample (注意场景3)。

关于c# - 如何在 UWP 中创建 Tab Header Pivot 控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37684883/

相关文章:

c# - 从响应中读取文本

c++ - 制作 : No rule to make a header file?

c++ - CentOS 5 内核头文件

python - 从数据透视表绘制 Pandas DataFrame

SQL Server - 动态数据透视表

c# - 获取在RichTextBox中输入的最后一个词c#

c# - 溢出我的内存,强制垃圾收集器?

c# - 欺骗应用程序关于鼠标位置的信息

http - 如何修改 CXF 中 JAX-WS 响应的 HTTP header ?

sql - 如何取消透视三种类型的值(包括列标题)