Initial event composing.
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.SingleCalendarPickerDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:calendar="using:Wino.Core.Domain.Models.Calendar"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
xmlns:helpers="using:Wino.Helpers"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:sharedCalendar="using:Wino.Core.Domain.Entities.Calendar"
|
||||
Title="{x:Bind domain:Translator.CalendarEventCompose_PickCalendarTitle}"
|
||||
PrimaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ContentDialog.Resources>
|
||||
<x:Double x:Key="ContentDialogMinWidth">420</x:Double>
|
||||
<Style
|
||||
x:Key="CalendarPickerListItemStyle"
|
||||
BasedOn="{StaticResource DefaultListViewItemStyle}"
|
||||
TargetType="ListViewItem">
|
||||
<Setter Property="Padding" Value="12,10" />
|
||||
<Setter Property="CornerRadius" Value="4" />
|
||||
<Setter Property="Margin" Value="0,2" />
|
||||
</Style>
|
||||
</ContentDialog.Resources>
|
||||
|
||||
<ScrollViewer Margin="0,8,0,0">
|
||||
<ItemsControl ItemsSource="{x:Bind AvailableGroups}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="0,0,0,12" Spacing="6">
|
||||
<TextBlock FontWeight="SemiBold">
|
||||
<Run Text="{Binding Account.Name}" />
|
||||
<Run Text=" (" />
|
||||
<Run Text="{Binding Account.Address}" />
|
||||
<Run Text=")" />
|
||||
</TextBlock>
|
||||
|
||||
<ListView
|
||||
IsItemClickEnabled="True"
|
||||
ItemClick="CalendarClicked"
|
||||
ItemContainerStyle="{StaticResource CalendarPickerListItemStyle}"
|
||||
ItemsSource="{Binding Calendars}"
|
||||
SelectionMode="None">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid ColumnSpacing="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Ellipse
|
||||
Width="14"
|
||||
Height="14"
|
||||
VerticalAlignment="Center"
|
||||
Fill="{ThemeResource AccentFillColorDefaultBrush}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</ContentDialog>
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Entities.Calendar;
|
||||
using Wino.Core.Domain.Models.Calendar;
|
||||
|
||||
namespace Wino.Dialogs;
|
||||
|
||||
public sealed partial class SingleCalendarPickerDialog : ContentDialog
|
||||
{
|
||||
public AccountCalendar? PickedCalendar { get; private set; }
|
||||
|
||||
public List<CalendarPickerAccountGroup> AvailableGroups { get; } = [];
|
||||
|
||||
public SingleCalendarPickerDialog(List<CalendarPickerAccountGroup> availableGroups)
|
||||
{
|
||||
AvailableGroups = availableGroups;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void CalendarClicked(object sender, ItemClickEventArgs e)
|
||||
{
|
||||
PickedCalendar = e.ClickedItem as AccountCalendar;
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user