Advertisement
Guest User

MonthYearPicker.xaml

a guest
Jan 2nd, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 7.40 KB | None | 0 0
  1. <!--
  2. // (c) Copyright Microsoft Corporation.
  3. // This source is subject to the Microsoft Public License (Ms-PL).
  4. // Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
  5. // All other rights reserved.
  6. -->
  7.  
  8. <controls1:DateTimePickerPageBase
  9.    x:Class="CustomDatePicker.View.MonthYearPicker"
  10.    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  11.    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  12.    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
  13.    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  14.    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
  15.    xmlns:primitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls.Toolkit"
  16.    xmlns:controls1="clr-namespace:CustomDatePicker.Classes"
  17.    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  18.    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  19.    FontFamily="{StaticResource PhoneFontFamilyNormal}"
  20.    FontSize="{StaticResource PhoneFontSizeNormal}"
  21.    Foreground="{StaticResource PhoneForegroundBrush}"
  22.    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
  23.    mc:Ignorable="d" d:DesignHeight="728" d:DesignWidth="480">
  24.  
  25.     <controls1:DateTimePickerPageBase.Resources>
  26.         <controls:DateTimePickerResources x:Key="DateTimePickerResources"/>
  27.         <ExponentialEase x:Key="Ease" EasingMode="EaseIn"/>
  28.     </controls1:DateTimePickerPageBase.Resources>
  29.  
  30.     <Grid Background="{StaticResource PhoneChromeBrush}">
  31.         <VisualStateManager.VisualStateGroups>
  32.             <VisualStateGroup x:Name="VisibilityStates">
  33.                 <VisualState x:Name="Open">
  34.                     <Storyboard>
  35.                         <DoubleAnimation
  36.                            Storyboard.TargetName="PlaneProjection"
  37.                            Storyboard.TargetProperty="RotationX"
  38.                            From="-50"
  39.                            To="0"
  40.                            Duration="0:0:0.2"/>
  41.                     </Storyboard>
  42.                 </VisualState>
  43.                 <VisualState x:Name="Closed">
  44.                     <Storyboard>
  45.                         <DoubleAnimation
  46.                            Storyboard.TargetName="PlaneProjection"
  47.                            Storyboard.TargetProperty="RotationX"
  48.                            To="90"
  49.                            Duration="0:0:0.2"
  50.                            EasingFunction="{StaticResource Ease}"/>
  51.                     </Storyboard>
  52.                 </VisualState>
  53.             </VisualStateGroup>
  54.         </VisualStateManager.VisualStateGroups>
  55.         <Grid.Projection>
  56.             <PlaneProjection x:Name="PlaneProjection"/>
  57.         </Grid.Projection>
  58.         <Grid.RowDefinitions>
  59.             <RowDefinition Height="Auto"/>
  60.             <RowDefinition Height="Auto"/>
  61.             <RowDefinition/>
  62.         </Grid.RowDefinitions>
  63.  
  64.         <!-- SystemTray placeholder -->
  65.         <Rectangle
  66.            x:Name="SystemTrayPlaceholder"
  67.            Grid.Row="0"
  68.            Height="32"/>
  69.         <!-- Title -->
  70.         <TextBlock
  71.            x:Name="HeaderTitle"
  72.            Grid.Row="1"
  73.            Text="{Binding DatePickerTitle, Source={StaticResource DateTimePickerResources}}"
  74.            FontFamily="{StaticResource PhoneFontFamilySemiBold}"
  75.            FontSize="{StaticResource PhoneFontSizeMedium}"
  76.            Foreground="{StaticResource PhoneForegroundBrush}"
  77.            Margin="24,16,24,24"/>
  78.         <!-- LoopingSelectors -->
  79.         <Grid
  80.            Grid.Row="2"
  81.            HorizontalAlignment="Center">
  82.             <Grid.ColumnDefinitions>
  83.                 <ColumnDefinition/>
  84.                 <ColumnDefinition/>
  85.                 <ColumnDefinition/>
  86.             </Grid.ColumnDefinitions>
  87.             <primitives:LoopingSelector
  88.                x:Name="SecondarySelector"
  89.                Grid.Column="0"
  90.                Width="148"
  91.                ItemSize="148,148"
  92.                ItemMargin="6">
  93.                 <primitives:LoopingSelector.ItemTemplate>
  94.                     <DataTemplate>
  95.                         <StackPanel
  96.                            HorizontalAlignment="Left"
  97.                            VerticalAlignment="Bottom"
  98.                            Margin="6">
  99.                             <TextBlock
  100.                                Text="{Binding MonthNumber}"
  101.                                FontSize="54"
  102.                                FontFamily="{StaticResource PhoneFontFamilySemiBold}"
  103.                                Margin="0,-8"/>
  104.                             <TextBlock
  105.                                Text="{Binding MonthName}"
  106.                                FontSize="20"
  107.                                FontFamily="{StaticResource PhoneFontFamilyNormal}"
  108.                                Margin="0,-2"/>
  109.                         </StackPanel>
  110.                     </DataTemplate>
  111.                 </primitives:LoopingSelector.ItemTemplate>
  112.             </primitives:LoopingSelector>
  113.             <primitives:LoopingSelector
  114.                Grid.Column="2"
  115.                x:Name="PrimarySelector"
  116.                Width="148"
  117.                ItemSize="148,148"
  118.                ItemMargin="6">
  119.                 <primitives:LoopingSelector.ItemTemplate>
  120.                     <DataTemplate>
  121.                         <StackPanel
  122.                            HorizontalAlignment="Left"
  123.                            VerticalAlignment="Bottom"
  124.                            Margin="6">
  125.                             <TextBlock
  126.                                Text="{Binding YearNumber}"
  127.                                FontSize="54"
  128.                                FontFamily="{StaticResource PhoneFontFamilySemiBold}"
  129.                                Margin="0,-8"/>
  130.                             <TextBlock
  131.                                Text=" "
  132.                                FontSize="20"
  133.                                FontFamily="{StaticResource PhoneFontFamilyNormal}"
  134.                                Margin="0,-2"/>
  135.                         </StackPanel>
  136.                     </DataTemplate>
  137.                 </primitives:LoopingSelector.ItemTemplate>
  138.             </primitives:LoopingSelector>
  139.         </Grid>
  140.     </Grid>
  141.  
  142.     <controls1:DateTimePickerPageBase.ApplicationBar>
  143.         <shell:ApplicationBar IsVisible="True">
  144.             <!--
  145.            Due to platform restrictions, ApplicationBarIconButton.IconUri content can not come from the
  146.            Microsoft.Phone.Controls.Toolkit assembly, so it is up to the application developer to ensure
  147.            these resources are placed in the right location and marked as Build Action=Content. For
  148.            convenience, platform-consistent images are included with the Toolkit installer.
  149.  
  150.            Note: ApplicationBarIconButton.Text automatically comes from the Microsoft.Phone.Controls.Toolkit
  151.            resources (where it can be localized).
  152.            -->
  153.             <shell:ApplicationBarIconButton
  154.                IconUri="/Toolkit.Content/ApplicationBar.Check.png"
  155.                Text="DONE"/>
  156.             <shell:ApplicationBarIconButton
  157.                IconUri="/Toolkit.Content/ApplicationBar.Cancel.png"
  158.                Text="CANCEL"/>
  159.         </shell:ApplicationBar>
  160.     </controls1:DateTimePickerPageBase.ApplicationBar>
  161.  
  162. </controls1:DateTimePickerPageBase>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement