Improved calendar rendering, standartization of some templates and cleanup of old styles.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<ItemsControl
|
||||
x:Name="PART_AllDayItemsList"
|
||||
ItemTemplate="{x:Bind AllDayEventTemplate}"
|
||||
ItemsSource="{x:Bind AllDayEvents, Mode=OneWay}" />
|
||||
ItemsSource="{x:Bind EventCollection.AllDayEvents}" />
|
||||
</ScrollViewer>
|
||||
<Button
|
||||
x:Name="AllDayItemsSummaryButton"
|
||||
@@ -25,7 +25,7 @@
|
||||
<Button.Flyout>
|
||||
<Flyout Placement="Bottom">
|
||||
<ScrollViewer>
|
||||
<ItemsControl ItemTemplate="{x:Bind AllDayEventTemplate}" ItemsSource="{x:Bind AllDayEvents, Mode=OneWay}" />
|
||||
<ItemsControl ItemTemplate="{x:Bind RegularEventItemTemplate}" ItemsSource="{x:Bind EventCollection.AllDayEvents}" />
|
||||
</ScrollViewer>
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
@@ -42,7 +42,7 @@
|
||||
<Setter Target="AllDayItemsSummaryButton.Content">
|
||||
<Setter.Value>
|
||||
<TextBlock>
|
||||
<Run Text="{x:Bind AllDayEvents.Count, Mode=OneWay, TargetNullValue='0'}" /> <Run Text="{x:Bind domain:Translator.CalendarAllDayEventSummary}" />
|
||||
<Run Text="{x:Bind EventCollection.AllDayEvents.Count, Mode=OneWay, TargetNullValue='0'}" /> <Run Text="{x:Bind domain:Translator.CalendarAllDayEventSummary}" />
|
||||
</TextBlock>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Generic;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Collections;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
|
||||
@@ -13,19 +14,36 @@ namespace Wino.Calendar.Controls
|
||||
|
||||
#region Dependency Properties
|
||||
|
||||
public static readonly DependencyProperty AllDayEventsProperty = DependencyProperty.Register(nameof(AllDayEvents), typeof(ObservableCollection<ICalendarItem>), typeof(AllDayItemsControl), new PropertyMetadata(null, new PropertyChangedCallback(OnAllDayEventsChanged)));
|
||||
public static readonly DependencyProperty EventCollectionProperty = DependencyProperty.Register(nameof(EventCollection), typeof(CalendarEventCollection), typeof(AllDayItemsControl), new PropertyMetadata(null, new PropertyChangedCallback(OnAllDayEventsChanged)));
|
||||
public static readonly DependencyProperty AllDayEventTemplateProperty = DependencyProperty.Register(nameof(AllDayEventTemplate), typeof(DataTemplate), typeof(AllDayItemsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty RegularEventItemTemplateProperty = DependencyProperty.Register(nameof(RegularEventItemTemplate), typeof(DataTemplate), typeof(AllDayItemsControl), new PropertyMetadata(null));
|
||||
|
||||
/// <summary>
|
||||
/// Item template for all-day events to display in summary view area.
|
||||
/// More than 2 events will be shown in Flyout.
|
||||
/// </summary>
|
||||
public DataTemplate AllDayEventTemplate
|
||||
{
|
||||
get { return (DataTemplate)GetValue(AllDayEventTemplateProperty); }
|
||||
set { SetValue(AllDayEventTemplateProperty, value); }
|
||||
}
|
||||
|
||||
public ObservableCollection<ICalendarItem> AllDayEvents
|
||||
/// <summary>
|
||||
/// Item template for all-day events to display in summary view's Flyout.
|
||||
/// </summary>
|
||||
public DataTemplate RegularEventItemTemplate
|
||||
{
|
||||
get { return (ObservableCollection<ICalendarItem>)GetValue(AllDayEventsProperty); }
|
||||
set { SetValue(AllDayEventsProperty, value); }
|
||||
get { return (DataTemplate)GetValue(RegularEventItemTemplateProperty); }
|
||||
set { SetValue(RegularEventItemTemplateProperty, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whole collection of events to display.
|
||||
/// </summary>
|
||||
public CalendarEventCollection EventCollection
|
||||
{
|
||||
get { return (CalendarEventCollection)GetValue(EventCollectionProperty); }
|
||||
set { SetValue(EventCollectionProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -39,12 +57,12 @@ namespace Wino.Calendar.Controls
|
||||
{
|
||||
if (d is AllDayItemsControl control)
|
||||
{
|
||||
if (e.OldValue != null && e.OldValue is ObservableCollection<ICalendarItem> oldCollection)
|
||||
if (e.OldValue != null && e.OldValue is CalendarEventCollection oldCollection)
|
||||
{
|
||||
control.UnregisterEventCollectionChanged(oldCollection);
|
||||
}
|
||||
|
||||
if (e.NewValue != null && e.NewValue is ObservableCollection<ICalendarItem> newCollection)
|
||||
if (e.NewValue != null && e.NewValue is CalendarEventCollection newCollection)
|
||||
{
|
||||
control.RegisterEventCollectionChanged(newCollection);
|
||||
}
|
||||
@@ -53,32 +71,35 @@ namespace Wino.Calendar.Controls
|
||||
}
|
||||
}
|
||||
|
||||
private void RegisterEventCollectionChanged(ObservableCollection<ICalendarItem> collection)
|
||||
private void RegisterEventCollectionChanged(CalendarEventCollection collection)
|
||||
{
|
||||
collection.CollectionChanged += EventsCollectionUpdated;
|
||||
collection.CalendarItemAdded += SingleEventUpdated;
|
||||
collection.CalendarItemRemoved += SingleEventUpdated;
|
||||
|
||||
collection.CalendarItemRangeAdded += CollectionOfEventsUpdated;
|
||||
collection.CalendarItemRangeRemoved += CollectionOfEventsUpdated;
|
||||
}
|
||||
|
||||
private void UnregisterEventCollectionChanged(ObservableCollection<ICalendarItem> collection)
|
||||
private void UnregisterEventCollectionChanged(CalendarEventCollection collection)
|
||||
{
|
||||
collection.CollectionChanged -= EventsCollectionUpdated;
|
||||
collection.CalendarItemAdded -= SingleEventUpdated;
|
||||
collection.CalendarItemRemoved -= SingleEventUpdated;
|
||||
|
||||
collection.CalendarItemRangeAdded -= CollectionOfEventsUpdated;
|
||||
collection.CalendarItemRangeRemoved -= CollectionOfEventsUpdated;
|
||||
}
|
||||
|
||||
private void EventsCollectionUpdated(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
UpdateCollectionVisuals();
|
||||
}
|
||||
private void SingleEventUpdated(object sender, ICalendarItem calendarItem) => UpdateCollectionVisuals();
|
||||
private void CollectionOfEventsUpdated(object sender, List<ICalendarItem> calendarItems) => UpdateCollectionVisuals();
|
||||
|
||||
private void UpdateCollectionVisuals()
|
||||
{
|
||||
if (AllDayEvents == null) return;
|
||||
if (EventCollection == null) return;
|
||||
|
||||
if (AllDayEvents.Count > 1)
|
||||
if (EventCollection.AllDayEvents.Count > 1)
|
||||
{
|
||||
// Summarize
|
||||
|
||||
VisualStateManager.GoToState(this, STATE_SummaryView, false);
|
||||
|
||||
// AllDayItemsSummaryButton.Content = $"{AllDayEvents.Count} {Translator.CalendarAllDayEventSummary}";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Calendar;
|
||||
|
||||
namespace Wino.Calendar.Controls
|
||||
{
|
||||
public class CalendarDayItemsControl : Control
|
||||
{
|
||||
private const string PART_CalendarPanel = nameof(PART_CalendarPanel);
|
||||
|
||||
private WinoCalendarPanel CalendarPanel;
|
||||
|
||||
public CalendarDayModel DayModel
|
||||
{
|
||||
get { return (CalendarDayModel)GetValue(DayModelProperty); }
|
||||
set { SetValue(DayModelProperty, value); }
|
||||
}
|
||||
|
||||
|
||||
public static readonly DependencyProperty DayModelProperty = DependencyProperty.Register(nameof(DayModel), typeof(CalendarDayModel), typeof(CalendarDayItemsControl), new PropertyMetadata(null, new PropertyChangedCallback(OnRepresentingDateChanged)));
|
||||
|
||||
private static void OnRepresentingDateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is CalendarDayItemsControl control)
|
||||
{
|
||||
if (e.OldValue != null && e.OldValue is CalendarDayModel oldCalendarDayModel)
|
||||
{
|
||||
control.DetachCollection(oldCalendarDayModel.EventsCollection);
|
||||
}
|
||||
|
||||
if (e.NewValue != null && e.NewValue is CalendarDayModel newCalendarDayModel)
|
||||
{
|
||||
control.AttachCollection(newCalendarDayModel.EventsCollection);
|
||||
}
|
||||
|
||||
control.ResetItems();
|
||||
control.RenderEvents();
|
||||
}
|
||||
}
|
||||
|
||||
public CalendarDayItemsControl()
|
||||
{
|
||||
DefaultStyleKey = typeof(CalendarDayItemsControl);
|
||||
}
|
||||
|
||||
protected override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
|
||||
CalendarPanel = GetTemplateChild(PART_CalendarPanel) as WinoCalendarPanel;
|
||||
|
||||
RenderEvents();
|
||||
}
|
||||
|
||||
private void ResetItems()
|
||||
{
|
||||
if (CalendarPanel == null) return;
|
||||
|
||||
CalendarPanel.Children.Clear();
|
||||
}
|
||||
|
||||
private void RenderEvents()
|
||||
{
|
||||
if (CalendarPanel == null || CalendarPanel.DayModel == null) return;
|
||||
|
||||
RenderCalendarItems();
|
||||
}
|
||||
|
||||
private void AttachCollection(ObservableCollection<ICalendarItem> newCollection)
|
||||
=> newCollection.CollectionChanged += CalendarItemsChanged;
|
||||
|
||||
private void DetachCollection(ObservableCollection<ICalendarItem> oldCollection)
|
||||
=> oldCollection.CollectionChanged -= CalendarItemsChanged;
|
||||
|
||||
private void CalendarItemsChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
switch (e.Action)
|
||||
{
|
||||
case NotifyCollectionChangedAction.Add:
|
||||
foreach (ICalendarItem item in e.NewItems)
|
||||
{
|
||||
AddItem(item);
|
||||
}
|
||||
break;
|
||||
case NotifyCollectionChangedAction.Remove:
|
||||
foreach (ICalendarItem item in e.OldItems)
|
||||
{
|
||||
var control = GetCalendarItemControl(item);
|
||||
if (control != null)
|
||||
{
|
||||
CalendarPanel.Children.Remove(control);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NotifyCollectionChangedAction.Reset:
|
||||
ResetItems();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private CalendarItemControl GetCalendarItemControl(ICalendarItem item)
|
||||
=> CalendarPanel.Children.Where(c => c is CalendarItemControl calendarItemControl && calendarItemControl.Item == item).FirstOrDefault() as CalendarItemControl;
|
||||
|
||||
private void RenderCalendarItems()
|
||||
{
|
||||
if (DayModel == null || DayModel.EventsCollection == null || DayModel.EventsCollection.Count == 0)
|
||||
{
|
||||
ResetItems();
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var item in DayModel.EventsCollection)
|
||||
{
|
||||
AddItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddItem(ICalendarItem item)
|
||||
{
|
||||
CalendarPanel.Children.Add(new CalendarItemControl()
|
||||
{
|
||||
Item = item
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Calendar.Controls
|
||||
{
|
||||
public class CalendarItemControl : Control
|
||||
{
|
||||
public ICalendarItem Item
|
||||
{
|
||||
get { return (ICalendarItem)GetValue(ItemProperty); }
|
||||
set { SetValue(ItemProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ItemProperty = DependencyProperty.Register(nameof(Item), typeof(ICalendarItem), typeof(CalendarItemControl), new PropertyMetadata(null, new PropertyChangedCallback(OnItemChanged)));
|
||||
|
||||
public CalendarItemControl()
|
||||
{
|
||||
DefaultStyleKey = typeof(CalendarItemControl);
|
||||
}
|
||||
|
||||
private static void OnItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is CalendarItemControl control)
|
||||
{
|
||||
control.UpdateDateRendering();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateDateRendering()
|
||||
{
|
||||
if (Item == null) return;
|
||||
|
||||
UpdateLayout();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Item?.Title ?? "NA";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,8 @@ using Windows.Foundation;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Calendar.Models;
|
||||
using Wino.Calendar.ViewModels.Data;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Calendar;
|
||||
|
||||
namespace Wino.Calendar.Controls
|
||||
{
|
||||
@@ -20,12 +20,13 @@ namespace Wino.Calendar.Controls
|
||||
private readonly Dictionary<Guid, CalendarItemMeasurement> _measurements = new Dictionary<Guid, CalendarItemMeasurement>();
|
||||
|
||||
public static readonly DependencyProperty EventItemMarginProperty = DependencyProperty.Register(nameof(EventItemMargin), typeof(Thickness), typeof(WinoCalendarPanel), new PropertyMetadata(new Thickness(0, 0, 0, 0)));
|
||||
public static readonly DependencyProperty DayModelProperty = DependencyProperty.Register(nameof(DayModel), typeof(CalendarDayModel), typeof(WinoCalendarPanel), new PropertyMetadata(null, new PropertyChangedCallback(OnDayChanged)));
|
||||
// public static readonly DependencyProperty RepresentingDateProperty = DependencyProperty.Register(nameof(RepresentingDate), typeof(DateTime), typeof(WinoCalendarControl), new PropertyMetadata(DateTime.MinValue));
|
||||
public static readonly DependencyProperty HourHeightProperty = DependencyProperty.Register(nameof(HourHeight), typeof(double), typeof(WinoCalendarPanel), new PropertyMetadata(0d));
|
||||
|
||||
public CalendarDayModel DayModel
|
||||
public double HourHeight
|
||||
{
|
||||
get { return (CalendarDayModel)GetValue(DayModelProperty); }
|
||||
set { SetValue(DayModelProperty, value); }
|
||||
get { return (double)GetValue(HourHeightProperty); }
|
||||
set { SetValue(HourHeightProperty, value); }
|
||||
}
|
||||
|
||||
public Thickness EventItemMargin
|
||||
@@ -34,51 +35,55 @@ namespace Wino.Calendar.Controls
|
||||
set { SetValue(EventItemMarginProperty, value); }
|
||||
}
|
||||
|
||||
private static void OnDayChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is WinoCalendarPanel control)
|
||||
{
|
||||
// We need to listen for new events being added or removed from the collection to reset measurements.
|
||||
if (e.OldValue is CalendarDayModel oldDayModel)
|
||||
{
|
||||
control.DetachCollection(oldDayModel.EventsCollection);
|
||||
}
|
||||
//private static void OnDayChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
//{
|
||||
// if (d is WinoCalendarPanel control)
|
||||
// {
|
||||
// // We need to listen for new events being added or removed from the collection to reset measurements.
|
||||
// if (e.OldValue is CalendarDayModel oldDayModel)
|
||||
// {
|
||||
// control.DetachCollection(oldDayModel.EventsCollection.RegularEvents);
|
||||
// }
|
||||
|
||||
if (e.NewValue is CalendarDayModel newDayModel)
|
||||
{
|
||||
control.AttachCollection(newDayModel.EventsCollection);
|
||||
}
|
||||
// if (e.NewValue is CalendarDayModel newDayModel)
|
||||
// {
|
||||
// control.AttachCollection(newDayModel.EventsCollection.RegularEvents);
|
||||
// }
|
||||
|
||||
control.ResetMeasurements();
|
||||
control.UpdateLayout();
|
||||
}
|
||||
}
|
||||
// control.ResetMeasurements();
|
||||
// control.UpdateLayout();
|
||||
// }
|
||||
//}
|
||||
|
||||
private void AttachCollection(IEnumerable<ICalendarItem> events)
|
||||
{
|
||||
if (events is INotifyCollectionChanged collection)
|
||||
{
|
||||
collection.CollectionChanged += EventCollectionChanged;
|
||||
}
|
||||
}
|
||||
//private void AttachCollection(IEnumerable<ICalendarItem> events)
|
||||
//{
|
||||
// if (events is INotifyCollectionChanged collection)
|
||||
// {
|
||||
// // var t = new Grid();
|
||||
|
||||
private void DetachCollection(IEnumerable<ICalendarItem> events)
|
||||
{
|
||||
if (events is INotifyCollectionChanged collection)
|
||||
{
|
||||
collection.CollectionChanged -= EventCollectionChanged;
|
||||
}
|
||||
}
|
||||
// collection.CollectionChanged += EventCollectionChanged;
|
||||
// }
|
||||
//}
|
||||
|
||||
//private void DetachCollection(IEnumerable<ICalendarItem> events)
|
||||
//{
|
||||
// if (events is INotifyCollectionChanged collection)
|
||||
// {
|
||||
// collection.CollectionChanged -= EventCollectionChanged;
|
||||
// }
|
||||
//}
|
||||
|
||||
private void ResetMeasurements() => _measurements.Clear();
|
||||
|
||||
// No need to handle actions. Each action requires a full measurement update.
|
||||
private void EventCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) => ResetMeasurements();
|
||||
|
||||
private double GetChildTopMargin(DateTimeOffset childStart, double availableHeight)
|
||||
private double GetChildTopMargin(ICalendarItem calendarItemViewModel, double availableHeight)
|
||||
{
|
||||
var childStart = calendarItemViewModel.StartTime;
|
||||
|
||||
double totalMinutes = 1440;
|
||||
double minutesFromStart = (childStart - DayModel.RepresentingDate).TotalMinutes;
|
||||
double minutesFromStart = (childStart - childStart.DateTime.Date).TotalMinutes;
|
||||
return (minutesFromStart / totalMinutes) * availableHeight;
|
||||
}
|
||||
|
||||
@@ -93,7 +98,7 @@ namespace Wino.Calendar.Controls
|
||||
private double GetChildHeight(DateTimeOffset childStart, DateTimeOffset childEnd)
|
||||
{
|
||||
double totalMinutes = 1440;
|
||||
double availableHeight = DayModel.CalendarRenderOptions.CalendarSettings.HourHeight * 24;
|
||||
double availableHeight = HourHeight * 24;
|
||||
double childDuration = (childEnd - childStart).TotalMinutes;
|
||||
return (childDuration / totalMinutes) * availableHeight;
|
||||
}
|
||||
@@ -112,31 +117,30 @@ namespace Wino.Calendar.Controls
|
||||
double availableHeight = finalSize.Height;
|
||||
double availableWidth = finalSize.Width;
|
||||
|
||||
var calendarControls = Children.Cast<CalendarItemControl>();
|
||||
var calendarControls = Children.Cast<ContentPresenter>();
|
||||
|
||||
// We need to exclude all-day events from the layout algorithm.
|
||||
// All-day events are displayed in a separate panel.
|
||||
if (!calendarControls.Any()) return base.ArrangeOverride(finalSize);
|
||||
|
||||
calendarControls = calendarControls.Where(x => x.Item.DurationInMinutes != 1440);
|
||||
|
||||
if (_measurements.Count == 0 && DayModel.EventsCollection.Count > 0)
|
||||
if (_measurements.Count == 0 && calendarControls.Any())
|
||||
{
|
||||
// We keep track of this collection when event is added/removed/reset etc.
|
||||
// So if the collection is empty, we must fill it up again for proper calculations.
|
||||
|
||||
LayoutEvents(DayModel.EventsCollection);
|
||||
var events = calendarControls.Select(a => a.Content as CalendarItemViewModel);
|
||||
|
||||
LayoutEvents(events);
|
||||
}
|
||||
|
||||
foreach (var child in calendarControls)
|
||||
foreach (var control in calendarControls)
|
||||
{
|
||||
// We can't arrange this child. It doesn't have a valid ICalendarItem or measurement.
|
||||
if (child.Item == null || !_measurements.ContainsKey(child.Item.Id)) continue;
|
||||
if (!(control.Content is ICalendarItem child) || !_measurements.ContainsKey(child.Id)) continue;
|
||||
|
||||
var childMeasurement = _measurements[child.Item.Id];
|
||||
var childMeasurement = _measurements[child.Id];
|
||||
|
||||
double childHeight = Math.Max(0, GetChildHeight(child.Item.StartTime, child.Item.StartTime.AddMinutes(child.Item.DurationInMinutes)));
|
||||
double childHeight = Math.Max(0, GetChildHeight(child.StartTime, child.StartTime.AddMinutes(child.DurationInMinutes)));
|
||||
double childWidth = Math.Max(0, GetChildWidth(childMeasurement, finalSize.Width));
|
||||
double childTop = Math.Max(0, GetChildTopMargin(child.Item.StartTime, availableHeight));
|
||||
double childTop = Math.Max(0, GetChildTopMargin(child, availableHeight));
|
||||
double childLeft = Math.Max(0, GetChildLeftMargin(childMeasurement, availableWidth));
|
||||
|
||||
bool isHorizontallyLastItem = childMeasurement.Right == 1;
|
||||
@@ -147,11 +151,11 @@ namespace Wino.Calendar.Controls
|
||||
|
||||
if (childWidth < 0) childWidth = 1;
|
||||
|
||||
child.Measure(new Size(childWidth, childHeight));
|
||||
control.Measure(new Size(childWidth, childHeight));
|
||||
|
||||
var arrangementRect = new Rect(childLeft + EventItemMargin.Left, childTop + EventItemMargin.Top, Math.Max(childWidth - extraRightMargin, 1), childHeight);
|
||||
|
||||
child.Arrange(arrangementRect);
|
||||
control.Arrange(arrangementRect);
|
||||
}
|
||||
|
||||
return finalSize;
|
||||
@@ -179,8 +183,6 @@ namespace Wino.Calendar.Controls
|
||||
|
||||
foreach (var ev in events.OrderBy(ev => ev.Period.Start).ThenBy(ev => ev.Period.End))
|
||||
{
|
||||
if (ev.Period.Duration.TotalMinutes == 1440) continue;
|
||||
|
||||
if (ev.Period.Start >= lastEventEnding)
|
||||
{
|
||||
PackEvents(columns);
|
||||
|
||||
Reference in New Issue
Block a user