1
0
mirror of https://github.com/XFox111/GUTSchedule.git synced 2026-04-22 06:58:01 +03:00

Code cleanup and optimizing

This commit is contained in:
Michael Gordeev
2020-03-14 09:23:24 +03:00
parent 79d58c0e12
commit 15cb370209
11 changed files with 30 additions and 114 deletions
@@ -0,0 +1,26 @@
<ContentDialog
x:Class="GUTSchedule.UWP.Controls.ClearCalendarControl"
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"
xmlns:appointments="using:Windows.ApplicationModel.Appointments"
mc:Ignorable="d"
x:Uid="clearScheduleTitle"
Loaded="ContentDialog_Loaded"
Title="Clear schedule calendar"
SecondaryButtonText="Cancel"
PrimaryButtonText="Clear">
<StackPanel>
<ListView SelectionMode="Multiple" x:Name="targetsList">
<ListView.ItemTemplate>
<DataTemplate x:DataType="appointments:AppointmentCalendar">
<TextBlock Text="{Binding DisplayName}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<CheckBox x:Uid="clearUpcoming" Content="Remove only upcoming events" x:Name="clearUpcoming"/>
</StackPanel>
</ContentDialog>
@@ -0,0 +1,17 @@
using System.Collections.Generic;
using Windows.UI.Xaml.Controls;
namespace GUTSchedule.UWP.Controls
{
public sealed partial class ClearCalendarControl : ContentDialog
{
public IEnumerable<object> SelectedCalendars => targetsList.SelectedItems;
public bool ClearUpcomingOnly => clearUpcoming.IsChecked.Value;
public ClearCalendarControl() =>
InitializeComponent();
private async void ContentDialog_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e) =>
targetsList.ItemsSource = await Calendar.GetCalendars();
}
}