Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CalendarView and CalendarDatePicker #6098

Merged
merged 81 commits into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
c9d32d0
chore(calendar): Import calendar C++ code from WinUI
dr1rrb Dec 3, 2020
1835b12
chore(calendar): Transpile C++ to C#
dr1rrb Dec 4, 2020
392e356
feat(calendar): Initial import of the CalendarView
dr1rrb Dec 18, 2020
53cca3f
feat(calendar): Make some items visible!
dr1rrb Jan 15, 2021
346ca7e
chore(calendar): Fix build after rebase.
carldebilly May 10, 2021
f0c90b4
feat(calendardatepicker): just finished translating the WinUI C++ cod…
carldebilly May 13, 2021
f06fb2f
test(calendardatepicker): Added a sample for CalendarDatePicker
carldebilly May 13, 2021
65547a8
test: Unify Date Picking samples category
carldebilly May 13, 2021
e89a48b
fix(pointer): IsLeftButtonPressed were wrongly true on the PointerRel…
carldebilly May 13, 2021
93ecfca
fix(calendardatepicker): Fixed default value for .Date : should be nu…
carldebilly May 13, 2021
f9b2a5b
test(calendardatepicker): Added DayOfWeekFormat to sample
carldebilly May 13, 2021
55b18a8
fix: Restore ability to have empty control template
dr1rrb May 11, 2021
099bbf7
feat(calendar): Make the CalendarView header appear, allowing to chan…
dr1rrb May 12, 2021
b6d1dc6
feat(calendar): Add support of selection (and navigating back to Deca…
dr1rrb May 12, 2021
430fe39
feat(calendar): Implement virtualisation
dr1rrb May 14, 2021
c7896da
chore(calendar): Fix merge issue
dr1rrb May 14, 2021
1589851
feat(calendar): Enable auto scrolling to today
dr1rrb May 14, 2021
0badfcf
feat(calendar): Enable phase loading
dr1rrb May 14, 2021
83dbbe4
feat: Support for WinUI's internal DXamlCore.GetLocalizedResourceStri…
carldebilly May 14, 2021
4e3180b
feat(calendardatepicker): Set default Min/Max date for CalendarDatePi…
carldebilly May 14, 2021
bc51190
fix(calendar): Fix decade/year/month navigation
dr1rrb May 14, 2021
eabe306
feat(calendar): Add support for Chrome
dr1rrb May 14, 2021
af2bf91
fix(calendardatepicker): Fixed compilation on other platforms
carldebilly May 17, 2021
7e170e2
fix(calendardatepicker): fixed date picking were not working.
carldebilly May 17, 2021
08229b9
fix(calendar): Fix blackout foreground color
dr1rrb May 17, 2021
1b5b8c6
refactor(onisenabledchanged): Refactored the way OnIsEnabledChanged i…
carldebilly May 17, 2021
8a9d037
refactor(borderrendered): .UpdateLayers() --> .UpdateLayer() on Andro…
carldebilly May 17, 2021
755e613
chore: fixed a bunch of build errors for CalendarView/CalendarDatePic…
carldebilly May 17, 2021
fe5911b
refactor: Changed `.Internal.cs` for `.MuxInternal.cs`
carldebilly May 17, 2021
590350b
feat: Add the BorderLayerRenderer on wasm
dr1rrb May 18, 2021
077f48e
fix(calendar): Fix measurement issues
dr1rrb May 18, 2021
149a6ee
fix(reg): Fix compilation issues on WASM
dr1rrb May 18, 2021
dbc743e
chore: Fixed compilation of CalendarDatePicker / CalendarView changes…
carldebilly May 19, 2021
d23a658
test(calendarview): Improved sample for CalendarView
carldebilly May 19, 2021
7b8bacd
fix(enability): Fixed a recent regression in generated code about IsE…
carldebilly May 20, 2021
31ae25b
fix(calendar): Fix vertical stretching (most probably not on Android …
dr1rrb May 21, 2021
130c4ca
chore(reg): Fix compilation on skia, wams and Android
dr1rrb May 21, 2021
e4f987e
fix(reg): Fix vertical stretching on Android
dr1rrb May 21, 2021
5cf9732
fix(calendar): Fix the Month and Decade views on Android
dr1rrb May 25, 2021
aa570e4
fix(calendar): Make sure to always fill the viewport
dr1rrb May 25, 2021
ab3ccb6
feat(scrollviewer): Implement the SCP.ScrollOwner (avoids anoying log…
dr1rrb May 25, 2021
ec1c39f
fix(calendar): Fix background not applied properly on all items
dr1rrb May 25, 2021
cf88024
fix(remotecontrol): Fixed annoying "Uri format" parsing error while l…
carldebilly May 20, 2021
3acff30
chore: fix failing build
carldebilly May 20, 2021
9943d91
fix(samplesapp): Fixed NRE during application starting.
carldebilly May 20, 2021
1db6243
test(calendarview): Added a new sample for CalendarView presenting on…
carldebilly May 25, 2021
4f4bcad
fix(calendarview): Fixed default min/max dates for CalendarView to us…
carldebilly May 25, 2021
c8adc03
chore: Revert "chore: fix failing build"
carldebilly May 25, 2021
9d1a1ae
refactor(calendarview): refactored samples for CalendarView
carldebilly May 26, 2021
3b2caaf
ci: fix build on iOS
carldebilly May 26, 2021
819e28e
fix(calendar): Fix decade and year view scrolling on wasm
dr1rrb May 26, 2021
9d22bd6
chore(calendar): Update teh fluent theme (same as UWP)
dr1rrb May 26, 2021
4702c59
fix(calendar): Fix first date always top/left
dr1rrb May 26, 2021
8610377
chore: fixed typo in sample
carldebilly May 26, 2021
ddb505a
fix(calendar): Fix possibly failing assert
dr1rrb May 26, 2021
7af5a44
fix(calendar): Fix stretching on iOS
dr1rrb May 26, 2021
2f2c505
test(calendarview): Added illustration for a discovered CalendarView …
carldebilly May 26, 2021
d4e2213
test(scrollviewer): Added a sample to illustrate nested scrollviewer …
carldebilly May 26, 2021
278c4e8
ci: makes the solution compile in Release configuration
carldebilly May 26, 2021
f9f463d
fix(calendar): Fix scrolling issues on iOS (inc. allow ChangeView on …
dr1rrb May 26, 2021
7d564b2
feat(calendar): Improve scrolling experience
dr1rrb May 27, 2021
c473ae1
fix(calendar): Fix today + selected visual state
dr1rrb May 27, 2021
8a3caac
chore(calendar): Apply MS reviews
dr1rrb May 28, 2021
5be2943
test: Added integrations tests from WinUI for CalendarView and Calend…
carldebilly May 28, 2021
bebfdb2
chore: Fix build
dr1rrb May 28, 2021
89de363
fix: Fix dependency generation not allowing to set only DPChangedCall…
dr1rrb May 31, 2021
ce82e76
test(calendar): Temporarily disable calendar tests
dr1rrb Jun 1, 2021
fb63c6b
chore: Apply code review comments
dr1rrb Jun 1, 2021
d589e89
fix(calendar): Fix possible null-ref
dr1rrb Jun 1, 2021
70c5afa
fix(calendar): Fix possible null ref in measure
dr1rrb Jun 1, 2021
a5392e6
fix: Fix merge issues
dr1rrb Jun 1, 2021
32ecb8d
fix: Fix ChangedView raised too early
dr1rrb Jun 2, 2021
d46acd2
fix: Possible null-ref in MenuBar
dr1rrb Jun 2, 2021
8ba9656
fix: Fixes DP generation
dr1rrb Jun 2, 2021
ba767c5
fix: Fix compilation of the ref library
dr1rrb Jun 2, 2021
d1f0296
fix: Fix possible scroll to out of bounds of the SV on iOS
dr1rrb Jun 2, 2021
0539f5f
chore: Config codacy to avoid spam
dr1rrb Jun 2, 2021
66d160c
chore: Fix ref assembly compilation
dr1rrb Jun 2, 2021
b44444d
chore: Fix WinUI compilation
dr1rrb Jun 2, 2021
d4b1a81
fix(calendar): Year and Decade views are not working on Android
dr1rrb Jun 2, 2021
c571040
chore: Config diff
dr1rrb Jun 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ exclude_paths:
- 'src/SamplesApp/**'
- '**/tsBindings/*.ts'
- 'doc/**'
- 'src/Uno.UI/Microsoft/UI/Xaml/Controls/Repeater/**'
- 'src/Uno.UI/Microsoft/UI/Xaml/Controls/Repeater/**'
- 'src/Uno.UI/UI/Xaml/Controls/CalendarView/**'
- 'src/Uno.UI/DirectUI/**'
52 changes: 51 additions & 1 deletion build/PackageDiffIgnore.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3681,15 +3681,65 @@
<Member
fullName="System.Void Windows.ApplicationModel.LeavingBackgroundEventArgs..ctor()"
reason="Not part of the UWP API" />
<Member
fullName="System.Void Windows.UI.Xaml.Controls.CalendarViewDayItemChangingEventArgs..ctor()"
reason="Not part of the UWP API" />
<Member
fullName="System.Void Windows.UI.Xaml.Controls.CalendarViewSelectedDatesChangedEventArgs..ctor()"
reason="Not part of the UWP API" />
<Member
fullName="System.Void Windows.UI.Xaml.Automation.Provider.IRawElementProviderSimple..ctor()"
reason="Not part of the UWP API" />
<Member
fullName="System.Void Windows.UI.Xaml.FrameworkElement.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
<Member
fullName="System.Void Windows.UI.Xaml.Controls.Picker.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
<Member
fullName="System.Void Windows.UI.Xaml.Controls.NativeListViewBase.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
<Member
fullName="System.Void Windows.UI.Xaml.Controls.NativePagedView.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
<Member
fullName="System.Void Windows.UI.Xaml.Controls.MultilineTextBoxView.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
<Member
fullName="System.Void Windows.UI.Xaml.Controls.SinglelineTextBoxView.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
<Member
fullName="System.Void Windows.UI.Xaml.Controls.SecureTextBoxView.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
<Member
fullName="System.Void Uno.UI.Controls.Legacy.ListViewBase.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
<Member
fullName="System.Void Uno.UI.Controls.Legacy.ListView.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
<Member
fullName="System.Void Uno.UI.Controls.Legacy.GridView.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
<Member
fullName="System.Void Uno.UI.Controls.Legacy.HorizontalListView.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
<Member
fullName="System.Void Uno.UI.Controls.Legacy.HorizontalGridView.OnIsEnabledChanged(System.Boolean oldValue, System.Boolean newValue)"
reason="Internal method which is not part of the UWP API" />
</Methods>
<Fields>
<Member
fullName="Windows.UI.Xaml.DependencyProperty Microsoft.UI.Xaml.Controls.XamlControlsResources::UseCompactResourcesProperty"
reason="This should be a property, not a field" />
<Member
fullName="System.Int32 Windows.UI.Xaml.Automation.Peers.PatternInterface::value__"
reason="This enum is an uint in UWP, not an int" />
</Fields>
<Properties>
</Properties>
</IgnoreSet> <!--
</IgnoreSet>

<!--
Supported nodes (please keep at the bottom of this file):
<Types>
</Types>
Expand Down
6 changes: 6 additions & 0 deletions src/SamplesApp/SamplesApp.Shared/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,13 @@ private async Task<bool> TryNavigateToLaunchSampleAsync(LaunchActivatedEventArgs
const string samplePrefix = "sample=";
try
{
if (launchActivatedEventArgs.Arguments == null)
{
return false;
}

var args = Uri.UnescapeDataString(launchActivatedEventArgs.Arguments);

if (string.IsNullOrEmpty(args) || !args.StartsWith(samplePrefix))
{
return false;
Expand Down
42 changes: 42 additions & 0 deletions src/SamplesApp/UITests.Shared/UITests.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,26 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CalendarView\CalendarDatePicker_Features.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CalendarView\CalendarView_Basics.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CalendarView\CalendarView_Features.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CalendarView\CalendarView_ScrollingRegion.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CalendarView\CalendarView_SmallRange.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\Canvas\Canvas_With_Outer_Clip.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -1525,6 +1545,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ScrollViewerTests\ScrollViewer_Nested.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ScrollViewerTests\ScrollViewer_Padding.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -4791,6 +4815,21 @@
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\Button\Buttons_Native.xaml.cs">
<DependentUpon>Buttons_Native.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CalendarView\CalendarDatePicker_Features.xaml.cs">
<DependentUpon>CalendarDatePicker_Features.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CalendarView\CalendarView_Basics.xaml.cs">
<DependentUpon>CalendarView_Basics.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CalendarView\CalendarView_Features.xaml.cs">
<DependentUpon>CalendarView_Features.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CalendarView\CalendarView_ScrollingRegion.xaml.cs">
<DependentUpon>CalendarView_ScrollingRegion.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CalendarView\CalendarView_SmallRange.xaml.cs">
<DependentUpon>CalendarView_SmallRange.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\Canvas\Canvas_With_Outer_Clip.xaml.cs">
<DependentUpon>Canvas_With_Outer_Clip.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -5158,6 +5197,9 @@
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ScrollViewerTests\ScrollViewer_Margin.xaml.cs">
<DependentUpon>ScrollViewer_Margin.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ScrollViewerTests\ScrollViewer_Nested.xaml.cs">
<DependentUpon>ScrollViewer_Nested.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ScrollViewerTests\ScrollViewer_Padding.xaml.cs">
<DependentUpon>ScrollViewer_Padding.xaml</DependentUpon>
</Compile>
Expand Down
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>
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();
}
}
}
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>
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();
}
}
}
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>
Loading