1

我正在使用<toolkit:TimePicker/>WP Toolkit
,它PickerPageUri设置为/Microsoft.Phone.Controls.Toolkit;component/DateTimePickers/TimePickerPage.xaml

我想在这个页面上进行一些自定义,比如它的背景应该是White
文本块应该是PICK TIME,应用栏背景应该是Gray
,图标应该是Black

在此处输入图像描述

我下载了TimePickerPage.xamlTimePickerPage.xaml.cs这样我就可以快速更改它的属性并将它的源设置为我的新CustomTimePickerPage.xaml的,它实际上包含 99% 的代码TimePickerPage.xaml

但它给了我下面的错误 在此处输入图像描述

谁能告诉我如何解决这个问题?

这是TimePickerPage.xaml

4

1 回答 1

1

问题是声明xmlns,下面是声明primitivescontrolsxmlns的正确方法

<primitives:DateTimePickerPageBase
    x:Class="FamilyMap.CustomUIElements.CustomTimePicker"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:primitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="728" d:DesignWidth="480">
于 2013-08-05T08:48:36.957 回答