我正在开发一个应用程序,我想使用一个与" DatePicker"相同工作的控件。
非常感谢任何帮助,我知道它的名字是Telerik Controls中的循环列表,但我没有订阅Telerik。
答案 0 :(得分:2)
您可以使用Windows Phone Toolkit
在您的解决方案的项目中转到参考资料>管理Nuget包>在线>搜索Phone.Controls> 安装Windows Phone Toolkit
在Xaml
添加xmlns名称空间
的xmlns:工具箱= “CLR-名称空间:Microsoft.Phone.Controls;装配= Microsoft.Phone.Controls.Toolkit”
并在网格中添加控件
<toolkit:DatePicker Header="Select Date"/>
<强>示例强>
<phone:PhoneApplicationPage
x:Class="TestApp.MainPage"
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"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
xmlns:toolkit="clr- namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
<TextBlock Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
//Add the Control
<toolkit:DatePicker Header="Select Date"/>
</Grid>
</Grid>
</phone:PhoneApplicationPage>
答案 1 :(得分:1)
请参阅以下Windows Phone 7示例,希望这适用于WP 8.1
http://www.geekchamp.com/articles/wp7-loopingselector-in-depth--part1-visual-structure-and-api
希望这可以帮到你
关于循环选择器