You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
6.5 KiB
114 lines
6.5 KiB
<!--*********************************************************************
|
|
|
|
Extended WPF Toolkit
|
|
|
|
Copyright (C) 2010-2012 Xceed Software Inc.
|
|
|
|
This program is provided to you under the terms of the Microsoft Public
|
|
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
|
|
|
|
This program can be provided to you by Xceed Software Inc. under a
|
|
proprietary commercial license agreement for use in non-Open Source
|
|
projects. The commercial version of Extended WPF Toolkit also includes
|
|
priority technical support, commercial updates, and many additional
|
|
useful WPF controls if you license Xceed Business Suite for WPF.
|
|
|
|
Visit http://xceed.com and follow @datagrid on Twitter.
|
|
|
|
********************************************************************-->
|
|
|
|
<sample:DemoView x:Class="Samples.Modules.DateTime.Views.HomeView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
xmlns:sample="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:conv="clr-namespace:Samples.Modules.DateTime.Converters"
|
|
Title="DateTime Controls"
|
|
Description="The DateTimePicker and TimePicker controls let you select the date and the time in several ways. The TimePicker is used in the DateTimePicker.">
|
|
<sample:DemoView.Resources>
|
|
<conv:DateTimeToTimeSpanConverter x:Key="dateTimeToTimeSpanConverter" />
|
|
|
|
<ObjectDataProvider x:Key="enumTimeFormatData" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
|
|
<ObjectDataProvider.MethodParameters>
|
|
<x:Type TypeName="xctk:TimeFormat"/>
|
|
</ObjectDataProvider.MethodParameters>
|
|
</ObjectDataProvider>
|
|
</sample:DemoView.Resources>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<GroupBox Header="Features" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" >
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
|
|
Orientation="Horizontal" >
|
|
<TextBlock Text="TimeFormat:" VerticalAlignment="Center" />
|
|
<ComboBox x:Name="_timeFormat" SelectedIndex="1" Grid.Column="1" ItemsSource="{Binding Source={StaticResource enumTimeFormatData}}" Width="100" Margin="5"/>
|
|
<TextBlock Text="TimeWatermark:" VerticalAlignment="Center"/>
|
|
<TextBox x:Name="_timeWatermark" Grid.Row="1" Grid.Column="1" Text="Enter Text" Width="100" VerticalAlignment="Center" Margin="5"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<StackPanel Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left">
|
|
<TextBlock Text="DateTimePicker Usage: " Margin="0,10,0,0" Style="{StaticResource Header}" />
|
|
<xctk:DateTimePicker x:Name="_datetimePicker"
|
|
Width="300"
|
|
VerticalAlignment="Top"
|
|
IsReadOnly="False"
|
|
TimeFormat="{Binding Source={x:Reference _timeFormat}, Path=SelectedItem}"
|
|
TimeWatermark="{Binding Source={x:Reference _timeWatermark}, Path=Text}"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch">
|
|
<GroupBox Header="TimePicker Features" Margin="0,15,0,0">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="StartTime:" VerticalAlignment="Center" />
|
|
<xctk:DateTimeUpDown x:Name="_startTime" Grid.Column="1" Format="ShortTime" Value="9:00" Width="100" Margin="5"/>
|
|
<TextBlock Text="EndTime:" Grid.Row="1" VerticalAlignment="Center" />
|
|
<xctk:DateTimeUpDown x:Name="_endTime" Grid.Row="1" Grid.Column="1" Format="ShortTime" Value="17:00" Width="100" Margin="5"/>
|
|
<TextBlock Text="TimeInterval:" Grid.Row="2" VerticalAlignment="Center" />
|
|
<xctk:DateTimeUpDown x:Name="_timeInterval" Grid.Row="2" Grid.Column="1" Format="Custom" FormatString="H:mm" Value="0:30" Width="100" Margin="5"/>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<StackPanel>
|
|
<TextBlock Text="TimePicker Usage: " Style="{StaticResource Header}" />
|
|
<xctk:TimePicker x:Name="_timePicker"
|
|
VerticalAlignment="Top"
|
|
BorderBrush="Black"
|
|
Format="{Binding Source={x:Reference _timeFormat}, Path=SelectedItem}"
|
|
Watermark="{Binding Source={x:Reference _timeWatermark}, Path=Text}"
|
|
StartTime="{Binding Source={x:Reference _startTime}, Path=Value, Converter={StaticResource dateTimeToTimeSpanConverter}}"
|
|
EndTime="{Binding Source={x:Reference _endTime}, Path=Value, Converter={StaticResource dateTimeToTimeSpanConverter}}"
|
|
TimeInterval="{Binding Source={x:Reference _timeInterval}, Path=Value, Converter={StaticResource dateTimeToTimeSpanConverter}}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Grid>
|
|
</sample:DemoView>
|
|
|