-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6098 from unoplatform/feature/calendar
Add CalendarView and CalendarDatePicker
- Loading branch information
Showing
244 changed files
with
31,610 additions
and
1,551 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
...App/UITests.Shared/Windows_UI_Xaml_Controls/CalendarView/CalendarDatePicker_Features.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<Page | ||
x:Class="UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarDatePicker_Features" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<StackPanel Spacing="12"> | ||
<StackPanel Orientation="Horizontal" Spacing="10" Background="LightBlue" Padding="3"> | ||
<ComboBox x:Name="dow" Header="FirstDayOfWeek"> | ||
<ComboBoxItem IsSelected="True">Sunday</ComboBoxItem> | ||
<ComboBoxItem>Monday</ComboBoxItem> | ||
<ComboBoxItem>Tuesday</ComboBoxItem> | ||
<ComboBoxItem>Wednesday</ComboBoxItem> | ||
<ComboBoxItem>Thursday</ComboBoxItem> | ||
<ComboBoxItem>Friday</ComboBoxItem> | ||
<ComboBoxItem>Saturday</ComboBoxItem> | ||
</ComboBox> | ||
<ComboBox x:Name="dowf" Header="DOW Format"> | ||
<!-- https://docs.microsoft.com/en-us/uwp/api/windows.globalization.datetimeformatting.datetimeformatter --> | ||
<ComboBoxItem Content="{}{dayofweek.full}"></ComboBoxItem> | ||
<ComboBoxItem Content="{}{dayofweek.abbreviated}" IsSelected="True"></ComboBoxItem> | ||
<ComboBoxItem Content="{}{dayofweek.abbreviated(2)}"></ComboBoxItem> | ||
<ComboBoxItem Content="{}{dayofweek.abbreviated(3)}"></ComboBoxItem> | ||
<ComboBoxItem Content="{}{dayofweek.solo.full}"></ComboBoxItem> | ||
<ComboBoxItem Content="{}{dayofweek.solo.abbreviated}"></ComboBoxItem> | ||
<ComboBoxItem Content="{}{dayofweek.solo.abbreviated(2)}"></ComboBoxItem> | ||
<ComboBoxItem Content="{}{dayofweek.solo.abbreviated(3)}"></ComboBoxItem> | ||
</ComboBox> | ||
<ComboBox x:Name="cid" Header="Calendar"> | ||
<ComboBoxItem>ChineseLunarCalendar</ComboBoxItem> | ||
<ComboBoxItem IsSelected="True">GregorianCalendar</ComboBoxItem> | ||
<ComboBoxItem>HebrewCalendar</ComboBoxItem> | ||
<ComboBoxItem>HijriCalendar</ComboBoxItem> | ||
<ComboBoxItem>JapaneseCalendar</ComboBoxItem> | ||
<ComboBoxItem>JapaneseLunarCalendar</ComboBoxItem> | ||
<ComboBoxItem>JulianCalendar</ComboBoxItem> | ||
<ComboBoxItem>KoreanCalendar</ComboBoxItem> | ||
<ComboBoxItem>KoreanLunarCalendar</ComboBoxItem> | ||
<ComboBoxItem>PersianCalendar</ComboBoxItem> | ||
<ComboBoxItem>TaiwanCalendar</ComboBoxItem> | ||
<ComboBoxItem>TaiwanLunarCalendar</ComboBoxItem> | ||
<ComboBoxItem>ThaiCalendar</ComboBoxItem> | ||
<ComboBoxItem>UmAlQuraCalendar</ComboBoxItem> | ||
<ComboBoxItem>VietnameseLunarCalendar</ComboBoxItem> | ||
</ComboBox> | ||
<ToggleButton x:Name="today" IsChecked="True">IsTodayHighlighted</ToggleButton> | ||
</StackPanel> | ||
<StackPanel Orientation="Horizontal" Spacing="10" Background="Bisque" Padding="3"> | ||
<CalendarDatePicker | ||
x:Name="cdp1" | ||
Header="Stock CalendarDatePicker" | ||
CalendarIdentifier="{Binding SelectedItem.Content, ElementName=cid, FallbackValue=GregorianCalendar}" | ||
FirstDayOfWeek="{Binding SelectedItem.Content, ElementName=dow, FallbackValue=Sunday}" | ||
DayOfWeekFormat="{Binding SelectedItem.Content, ElementName=dowf}" | ||
IsTodayHighlighted="{Binding IsChecked, ElementName=today}"/> | ||
<ToggleButton IsChecked="{Binding IsEnabled, ElementName=cdp1, Mode=TwoWay}"> | ||
IsEnabled | ||
</ToggleButton> | ||
<ToggleButton IsChecked="{Binding IsCalendarOpen, ElementName=cdp1, Mode=TwoWay}"> | ||
IsCalendarOpen | ||
</ToggleButton> | ||
<TextBox Header="Header" Text="{Binding Header, ElementName=cdp1, Mode=TwoWay}" /> | ||
<TextBlock>Date: <Run Text="{Binding Date, ElementName=cdp1}" /></TextBlock> | ||
</StackPanel> | ||
<StackPanel Orientation="Horizontal" Spacing="10" Background="Bisque" Padding="3"> | ||
<CalendarDatePicker | ||
x:Name="cdp2" | ||
CalendarIdentifier="{Binding SelectedItem.Content, ElementName=cid, FallbackValue=GregorianCalendar}" | ||
Header="IsCalendarOpen=True" | ||
IsCalendarOpen="True" | ||
IsEnabled="False" | ||
FirstDayOfWeek="{Binding SelectedItem.Content, ElementName=dow}" | ||
DayOfWeekFormat="{Binding SelectedItem.Content, ElementName=dowf}" | ||
IsTodayHighlighted="{Binding IsChecked, ElementName=today}" /> | ||
<ToggleButton IsChecked="{Binding IsEnabled, ElementName=cdp2, Mode=TwoWay}"> | ||
IsEnabled | ||
</ToggleButton> | ||
<ToggleButton IsChecked="{Binding IsCalendarOpen, ElementName=cdp2, Mode=TwoWay}"> | ||
IsCalendarOpen | ||
</ToggleButton> | ||
<TextBox Header="Header" Text="{Binding Header, ElementName=cdp2, Mode=TwoWay}" /> | ||
|
||
<TextBlock>Date: <Run Text="{Binding Date, ElementName=cdp2}" /></TextBlock> | ||
</StackPanel> | ||
<StackPanel Orientation="Horizontal" Spacing="10" Background="Bisque" Padding="3"> | ||
<CalendarDatePicker | ||
x:Name="cdp3" | ||
CalendarIdentifier="{Binding SelectedItem.Content, ElementName=cid, FallbackValue=GregorianCalendar}" | ||
Header="IsGroupLabelVisible=False" | ||
PlaceholderText="--PLACEHOLDER--" | ||
IsGroupLabelVisible="False" | ||
DayOfWeekFormat="{Binding SelectedItem.Content, ElementName=dowf}" | ||
FirstDayOfWeek="{Binding SelectedItem.Content, ElementName=dow}" | ||
IsTodayHighlighted="{Binding IsChecked, ElementName=today}" /> | ||
<ToggleButton IsChecked="{Binding IsEnabled, ElementName=cdp3, Mode=TwoWay}"> | ||
IsEnabled | ||
</ToggleButton> | ||
<ToggleButton IsChecked="{Binding IsCalendarOpen, ElementName=cdp3, Mode=TwoWay}"> | ||
IsCalendarOpen | ||
</ToggleButton> | ||
|
||
<TextBlock>Date: <Run Text="{Binding Date, ElementName=cdp3}" /></TextBlock> | ||
</StackPanel> | ||
</StackPanel> | ||
</Page> |
14 changes: 14 additions & 0 deletions
14
.../UITests.Shared/Windows_UI_Xaml_Controls/CalendarView/CalendarDatePicker_Features.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Windows.UI.Xaml.Controls; | ||
using Uno.UI.Samples.Controls; | ||
|
||
namespace UITests.Windows_UI_Xaml_Controls.CalendarView | ||
{ | ||
[Sample("Date Picking")] | ||
public sealed partial class CalendarDatePicker_Features : Page | ||
{ | ||
public CalendarDatePicker_Features() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CalendarView/CalendarView_Basics.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Page | ||
x:Class="UITests.Windows_UI_Xaml_Controls.CalendarViewTests.CalendarView_Basics" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Xaml_Controls.CalendarViewTests" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<Grid> | ||
<TextBlock VerticalAlignment="Top">This is a vanilla CalendarView...</TextBlock> | ||
<CalendarView x:Name="sut" /> | ||
</Grid> | ||
</Page> |
16 changes: 16 additions & 0 deletions
16
...mplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CalendarView/CalendarView_Basics.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Linq; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Uno.UI.Samples.Controls; | ||
|
||
namespace UITests.Windows_UI_Xaml_Controls.CalendarViewTests | ||
{ | ||
[Sample("Date Picking")] | ||
public sealed partial class CalendarView_Basics : Page | ||
{ | ||
public CalendarView_Basics() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...amplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CalendarView/CalendarView_Features.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<Page | ||
x:Class="UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Features" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
|
||
</Grid.ColumnDefinitions> | ||
|
||
<CalendarView x:Name="sut" | ||
FirstDayOfWeek="{Binding SelectedItem.Content, ElementName=dow, Mode=TwoWay}" | ||
SelectionMode="{Binding SelectedItem.Content, ElementName=selection, Mode=TwoWay}" | ||
DisplayMode="{Binding SelectedItem.Content, ElementName=mode, FallbackValue=Month, Mode=TwoWay}" /> | ||
|
||
<StackPanel Grid.Column="1" Background="#20000000" Margin="5" Spacing="5"> | ||
<StackPanel Orientation="Horizontal" Spacing="5"> | ||
<ComboBox x:Name="mode" Header="DisplayMode"> | ||
<ComboBoxItem IsSelected="True">Month</ComboBoxItem> | ||
<ComboBoxItem>Decade</ComboBoxItem> | ||
<ComboBoxItem>Year</ComboBoxItem> | ||
</ComboBox> | ||
<ComboBox x:Name="selection" Header="SelectionMode"> | ||
<ComboBoxItem IsSelected="True">Single</ComboBoxItem> | ||
<ComboBoxItem>Multiple</ComboBoxItem> | ||
<ComboBoxItem>None</ComboBoxItem> | ||
</ComboBox> | ||
<ComboBox x:Name="dow" Header="FirstDayOfWeek"> | ||
<ComboBoxItem IsSelected="True">Sunday</ComboBoxItem> | ||
<ComboBoxItem>Monday</ComboBoxItem> | ||
<ComboBoxItem>Tuesday</ComboBoxItem> | ||
<ComboBoxItem>Wednesday</ComboBoxItem> | ||
<ComboBoxItem>Thursday</ComboBoxItem> | ||
<ComboBoxItem>Friday</ComboBoxItem> | ||
<ComboBoxItem>Saturday</ComboBoxItem> | ||
</ComboBox> | ||
<ToggleButton x:Name="today" IsChecked="{Binding IsTodayHighlighted, ElementName=sut, Mode=TwoWay}">IsTodayHighlighted</ToggleButton> | ||
</StackPanel> | ||
<StackPanel Orientation="Horizontal" Spacing="5"> | ||
<DatePicker x:Name="min" Header="MinDate" Date="{Binding MinDate, ElementName=sut, Mode=TwoWay}" /> | ||
<DatePicker x:Name="max" Header="MaxDate" Date="{Binding MaxDate, ElementName=sut, Mode=TwoWay}" /> | ||
</StackPanel> | ||
|
||
<StackPanel Orientation="Horizontal" Spacing="5"> | ||
<DatePicker x:Name="setDisplayDate" Header="SetDisplayDate" /> | ||
<Button Click="SetDisplayDate">Set</Button> | ||
</StackPanel> | ||
|
||
<TextBlock>Selected Date(s):</TextBlock> | ||
<ItemsControl x:Name="selected" /> | ||
</StackPanel> | ||
</Grid></Page> |
Oops, something went wrong.