This file contains hidden or 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
| <StackPanel Orientation="Horizontal"> | |
| <BitmapIcon UriSource="ms-appx:///Assets/windows.png" /> | |
| <BitmapIcon UriSource="ms-appx:///Assets/windows.png" ShowAsMonochrome="False" /> | |
| </StackPanel> |
This file contains hidden or 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
| private void Calendar_CalendarViewDayItemChanging(CalendarView sender, CalendarViewDayItemChangingEventArgs args) | |
| { | |
| if (_highlightedDates.Contains(args.Item.Date)) | |
| { | |
| HighlightDay(args.Item); | |
| } | |
| else | |
| { | |
| UnHighlightDay(args.Item); | |
| } |
This file contains hidden or 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
| private static void HighlightDay(CalendarViewDayItem displayedDay) | |
| { | |
| displayedDay.Background = new SolidColorBrush(Colors.Red); | |
| } | |
| private static void UnHighlightDay(CalendarViewDayItem displayedDay) | |
| { | |
| displayedDay.Background = new SolidColorBrush(Colors.Transparent); | |
| } |
This file contains hidden or 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
| private void UpdateCalendar() | |
| { | |
| var displayedDays = Calendar.FindDescendants<CalendarViewDayItem>(); | |
| foreach (var displayedDay in displayedDays) | |
| { | |
| if (_highlightedDates.Contains(displayedDay.Date.Date)) | |
| { | |
| HighlightDay(displayedDay); | |
| } | |
| else |
This file contains hidden or 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
| using Microsoft.Toolkit.Uwp.UI.Extensions; |
This file contains hidden or 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
| private void Add_Click(object sender, RoutedEventArgs e) | |
| { | |
| _highlightedDates.Add(Picker.Date.Date); | |
| UpdateCalendar(); | |
| } |
This file contains hidden or 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
| private void Add_Click(object sender, RoutedEventArgs e) | |
| { | |
| _highlightedDates.Add(Picker.Date.Date); | |
| UpdateCalendar(); | |
| } |
This file contains hidden or 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
| private List<DateTimeOffset> _highlightedDates = new List<DateTimeOffset>(); |
This file contains hidden or 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
| <StackPanel Padding="20" Spacing="20"> | |
| <DatePicker x:Name="Picker" /> | |
| <Button Click="Add_Click">Add</Button> | |
| <CalendarView CalendarViewDayItemChanging="Calendar_CalendarViewDayItemChanging" x:Name="Calendar" /> | |
| </StackPanel> |
This file contains hidden or 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
| <ItemGroup> | |
| <ImageAsset Include="Media.xcassets\AppIcon.appiconset\ipad-76x76%402x.png" /> | |
| ... | |
| </ItemGroup> |