0
我試圖在新的WP7應用程序中實現TimePicker .. 但是當我運行應用程序時... 總是有一個錯誤:TimePicker:Silverlight工具包錯誤:'屬性值控件無效:屬性TargetType的LongListSelector'
'無效的屬性值控制:LongListSelector財產的TargetType'
這是我的XAML代碼
<phone:PhoneApplicationPage
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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
x:Class="WindowsPhoneApplication3.NewOrEditCoursePage"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
Orientation="Portrait"
shell:SystemTray.IsVisible="True" >
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" MinHeight="607"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock x:Name="ApplicationTitle" Text="" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<StackPanel HorizontalAlignment="Left" Height="450" Margin="8,8,0,0" VerticalAlignment="Top" Width="440">
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" Text="" Margin="0,0,0,5" Foreground="{StaticResource PhoneSubtleBrush}"/>
<TextBox TextWrapping="Wrap" Text="TextBox"/>
</StackPanel>
<controls:TimePicker Header="StartTime" Width="440" Height="100"/>
<controls:TimePicker Header="EndTime" Width="440" Height="100" />
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" Text="Address" Foreground="{StaticResource PhoneSubtleBrush}" />
<TextBox TextWrapping="Wrap" Text="TextBox"/>
</StackPanel>
</StackPanel>
<StackPanel HorizontalAlignment="Left" Height="100" VerticalAlignment="Bottom" Width="400" Margin="36,0,0,8" Orientation="Horizontal">
<Button Content="Submit" HorizontalAlignment="Left" Width="200" Height="80"/>
<Button Content="Cancel" Width="200" Height="80"/>
</StackPanel>
</Grid>
</Grid>
</phone:PhoneApplicationPage>
順便說一下,我添加了「Microsoft.Phone.Controls.Toolkit.dll」