Files
Wino-Mail/Wino.Calendar/Controls/AllDayItemsControl.xaml

55 lines
2.5 KiB
XML

<UserControl
x:Class="Wino.Calendar.Controls.AllDayItemsControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Wino.Calendar.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:domain="using:Wino.Core.Domain"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="300"
d:DesignWidth="400"
mc:Ignorable="d">
<Grid>
<ScrollViewer x:Name="PART_AllDayItemsListScrollHost">
<ItemsControl
x:Name="PART_AllDayItemsList"
ItemTemplate="{x:Bind AllDayEventTemplate}"
ItemsSource="{x:Bind EventCollection.AllDayEvents}" />
</ScrollViewer>
<Button
x:Name="AllDayItemsSummaryButton"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Visibility="Collapsed">
<Button.Flyout>
<Flyout Placement="Bottom">
<ScrollViewer>
<ItemsControl ItemTemplate="{x:Bind RegularEventItemTemplate}" ItemsSource="{x:Bind EventCollection.AllDayEvents}" />
</ScrollViewer>
</Flyout>
</Button.Flyout>
</Button>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="ViewStates">
<VisualState x:Name="FullView" />
<VisualState x:Name="SummaryView">
<VisualState.Setters>
<Setter Target="PART_AllDayItemsListScrollHost.Visibility" Value="Collapsed" />
<Setter Target="PART_AllDayItemsList.Visibility" Value="Collapsed" />
<Setter Target="AllDayItemsSummaryButton.Visibility" Value="Visible" />
<Setter Target="AllDayItemsSummaryButton.Content">
<Setter.Value>
<TextBlock>
<Run Text="{x:Bind EventCollection.AllDayEvents.Count, Mode=OneWay, TargetNullValue='0'}" /> <Run Text="{x:Bind domain:Translator.CalendarAllDayEventSummary}" />
</TextBlock>
</Setter.Value>
</Setter>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</UserControl>