94 lines
4.8 KiB
XML
94 lines
4.8 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:calendarHelpers="using:Wino.Calendar.Helpers"
|
|
xmlns:controls="using:Wino.Calendar.Controls"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:data="using:Wino.Calendar.ViewModels.Data"
|
|
xmlns:domain="using:Wino.Core.Domain"
|
|
xmlns:helpers="using:Wino.Helpers"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:selectors="using:Wino.Calendar.Selectors"
|
|
x:Name="AllDayControl"
|
|
d:DesignHeight="300"
|
|
d:DesignWidth="400"
|
|
mc:Ignorable="d">
|
|
|
|
<Grid>
|
|
<ItemsControl x:Name="EventItemsControl" ItemsSource="{x:Bind CalendarDayModel.EventsCollection.AllDayEvents, Mode=OneWay}">
|
|
<ItemsControl.ItemTemplateSelector>
|
|
<selectors:CustomAreaCalendarItemSelector>
|
|
<selectors:CustomAreaCalendarItemSelector.AllDayTemplate>
|
|
<DataTemplate x:DataType="data:CalendarItemViewModel">
|
|
<controls:CalendarItemControl
|
|
CalendarItem="{x:Bind}"
|
|
DisplayingDate="{Binding CalendarDayModel, ElementName=AllDayControl}"
|
|
IsCustomEventArea="True" />
|
|
</DataTemplate>
|
|
</selectors:CustomAreaCalendarItemSelector.AllDayTemplate>
|
|
<selectors:CustomAreaCalendarItemSelector.MultiDayTemplate>
|
|
<DataTemplate x:DataType="data:CalendarItemViewModel">
|
|
<controls:CalendarItemControl
|
|
CalendarItem="{x:Bind}"
|
|
DisplayingDate="{Binding CalendarDayModel, ElementName=AllDayControl}"
|
|
IsCustomEventArea="True" />
|
|
</DataTemplate>
|
|
</selectors:CustomAreaCalendarItemSelector.MultiDayTemplate>
|
|
</selectors:CustomAreaCalendarItemSelector>
|
|
</ItemsControl.ItemTemplateSelector>
|
|
<ItemsControl.ItemContainerTransitions>
|
|
<TransitionCollection>
|
|
<AddDeleteThemeTransition />
|
|
</TransitionCollection>
|
|
</ItemsControl.ItemContainerTransitions>
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Vertical" Spacing="2" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
</ItemsControl>
|
|
|
|
<!--<controls:CalendarItemControl
|
|
x:Name="SingleAllDayEventHolder"
|
|
CalendarItem="{x:Bind calendarHelpers:CalendarXamlHelpers.GetFirstAllDayEvent(EventCollection), Mode=OneWay}"
|
|
Visibility="{x:Bind helpers:XamlHelpers.CountToVisibilityConverter(EventCollection.AllDayEvents.Count), Mode=OneWay}" />
|
|
|
|
<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="SingleAllDayEventHolder.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.StateTriggers>
|
|
<StateTrigger IsActive="{x:Bind helpers:XamlHelpers.IsMultiple(EventCollection.AllDayEvents.Count), Mode=OneWay, FallbackValue='False'}" />
|
|
</VisualState.StateTriggers>
|
|
</VisualState>
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>-->
|
|
</Grid>
|
|
</UserControl>
|