Single synchronizer for calendar and mail.
This commit is contained in:
@@ -27,6 +27,9 @@
|
||||
<ResourceDictionary Source="Styles/WinoCalendarTypeSelectorControl.xaml" />
|
||||
|
||||
<styles:CalendarItemControlResources />
|
||||
|
||||
<!-- Last item must always be the default theme. -->
|
||||
<ResourceDictionary Source="ms-appx:///Wino.Core.UWP/AppThemes/Mica.xaml" />
|
||||
</controls:XamlControlsResources.MergedDictionaries>
|
||||
</controls:XamlControlsResources>
|
||||
</Application.Resources>
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace Wino.Calendar
|
||||
services.AddSingleton<ICalendarDialogService, DialogService>();
|
||||
services.AddTransient<ISettingsBuilderService, SettingsBuilderService>();
|
||||
services.AddTransient<IProviderService, ProviderService>();
|
||||
services.AddSingleton<IAuthenticatorConfig, CalendarAuthenticatorConfig>();
|
||||
}
|
||||
|
||||
private void RegisterViewModels(IServiceCollection services)
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Wino.Calendar.Controls
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Item?.Name ?? "NA";
|
||||
return Item?.Title ?? "NA";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Wino.Calendar.Controls
|
||||
// No need to handle actions. Each action requires a full measurement update.
|
||||
private void EventCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) => ResetMeasurements();
|
||||
|
||||
private double GetChildTopMargin(DateTime childStart, double availableHeight)
|
||||
private double GetChildTopMargin(DateTimeOffset childStart, double availableHeight)
|
||||
{
|
||||
double totalMinutes = 1440;
|
||||
double minutesFromStart = (childStart - DayModel.RepresentingDate).TotalMinutes;
|
||||
@@ -90,7 +90,7 @@ namespace Wino.Calendar.Controls
|
||||
private double GetChildLeftMargin(CalendarItemMeasurement calendarItemMeasurement, double availableWidth)
|
||||
=> availableWidth * calendarItemMeasurement.Left;
|
||||
|
||||
private double GetChildHeight(DateTime childStart, DateTime childEnd)
|
||||
private double GetChildHeight(DateTimeOffset childStart, DateTimeOffset childEnd)
|
||||
{
|
||||
double totalMinutes = 1440;
|
||||
double availableHeight = DayModel.CalendarRenderOptions.CalendarSettings.HourHeight * 24;
|
||||
@@ -146,7 +146,7 @@ namespace Wino.Calendar.Controls
|
||||
|
||||
child.Measure(new Size(childWidth, childHeight));
|
||||
|
||||
var arrangementRect = new Rect(childLeft + EventItemMargin.Left, childTop + EventItemMargin.Top, childWidth - extraRightMargin, childHeight);
|
||||
var arrangementRect = new Rect(childLeft + EventItemMargin.Left, childTop + EventItemMargin.Top, Math.Max(childWidth - extraRightMargin, 1), childHeight);
|
||||
|
||||
child.Arrange(arrangementRect);
|
||||
}
|
||||
|
||||
30
Wino.Calendar/Services/CalendarAuthenticatorConfig.cs
Normal file
30
Wino.Calendar/Services/CalendarAuthenticatorConfig.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Calendar.Services
|
||||
{
|
||||
public class CalendarAuthenticatorConfig : IAuthenticatorConfig
|
||||
{
|
||||
public string OutlookAuthenticatorClientId => "b19c2035-d740-49ff-b297-de6ec561b208";
|
||||
|
||||
public string[] OutlookScope => new string[]
|
||||
{
|
||||
"Calendars.Read",
|
||||
"Calendars.Read.Shared",
|
||||
"offline_access",
|
||||
"Calendars.ReadBasic",
|
||||
"Calendars.ReadWrite",
|
||||
"Calendars.ReadWrite.Shared",
|
||||
"User.Read"
|
||||
};
|
||||
|
||||
public string GmailAuthenticatorClientId => "973025879644-s7b4ur9p3rlgop6a22u7iuptdc0brnrn.apps.googleusercontent.com";
|
||||
|
||||
public string[] GmailScope => new string[]
|
||||
{
|
||||
"https://mail.google.com/",
|
||||
"https://www.googleapis.com/auth/calendar",
|
||||
"https://www.googleapis.com/auth/calendar.events",
|
||||
"https://www.googleapis.com/auth/calendar.settings.readonly"
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Bind Item.Name, Mode=OneWay}" />
|
||||
Text="{x:Bind Item.Title, Mode=OneWay}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
||||
@@ -152,6 +152,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Models\CalendarItemMeasurement.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\CalendarAuthenticatorConfig.cs" />
|
||||
<Compile Include="Services\DialogService.cs" />
|
||||
<Compile Include="Services\NavigationService.cs" />
|
||||
<Compile Include="Services\ProviderService.cs" />
|
||||
|
||||
Reference in New Issue
Block a user