Skip to content

Commit

Permalink
Merge pull request #487 from telerik/development
Browse files Browse the repository at this point in the history
Merge develoment into master
  • Loading branch information
polqnaP committed Feb 24, 2021
2 parents aa472be + c555c21 commit 6e5cae5
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 159 deletions.
156 changes: 78 additions & 78 deletions BuildTools/BuildControls.UWP.proj
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">

<Import Project="$(MSBuildProjectDirectory)\Config.UWP.proj" />

<PropertyGroup>
<BuildDependsOn>
GetLatestNugetExe;
RestoreControlsSolutionNuGetPackages;
BuildControlsSolution;
RestoreMapSolutionNuGetPackages;
BuildMapX86Platform;
BuildMapX64Platform;
BuildMapArmPlatform;
BuildMapArm64Platform;
</BuildDependsOn>
</PropertyGroup>


<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />

<Target Name="GetLatestNugetExe">

<Exec Command="$(PowerShellExe) -NonInteractive -executionpolicy Unrestricted -command (New-Object System.Net.WebClient).DownloadFile('http://dist.nuget.org/win-x86-commandline/latest/nuget.exe', 'nuget.exe')"/>

</Target>

<Target Name="RestoreControlsSolutionNuGetPackages">

<Exec Command="$(Nuget32ToolPath) restore $(UWPControlsSolutionPath) -NonInteractive -Source https://api.nuget.org/v3/index.json" />

</Target>

<Target Name="BuildControlsSolution">

<MSBuild Projects="$(UWPControlsSolutionPath)"
Properties="Configuration=$(Configuration);Platform=$(AnyCPUPlatform)"
Targets="Rebuild" />
</Target>

<Target Name="RestoreMapSolutionNuGetPackages">

<MSBuild Projects="$(UWPMapSolutionPath)" Targets="Restore" />

</Target>

<Target Name="BuildMapX86Platform">

<MSBuild Projects="$(UWPMapSolutionPath)"
Properties="Configuration=$(Configuration);Platform=$(X86Platform)"
Targets="Rebuild" />
</Target>

<Target Name="BuildMapX64Platform">

<MSBuild Projects="$(UWPMapSolutionPath)"
Properties="Configuration=$(Configuration);Platform=$(X64Platform)"
Targets="Rebuild" />

</Target>

<Target Name="BuildMapArmPlatform">

<MSBuild Projects="$(UWPMapSolutionPath)"
Properties="Configuration=$(Configuration);Platform=$(ArmPlatform)"
Targets="Rebuild" />

</Target>

<Target Name="BuildMapArm64Platform">

<MSBuild Projects="$(UWPMapSolutionPath)"
Properties="Configuration=$(Configuration);Platform=$(Arm64Platform)"
Targets="Rebuild" />

</Target>

</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">

<Import Project="$(MSBuildProjectDirectory)\Config.UWP.proj" />

<PropertyGroup>
<BuildDependsOn>
GetLatestNugetExe;
RestoreControlsSolutionNuGetPackages;
BuildControlsSolution;
RestoreMapSolutionNuGetPackages;
BuildMapX86Platform;
BuildMapX64Platform;
BuildMapArmPlatform;
BuildMapArm64Platform;
</BuildDependsOn>
</PropertyGroup>


<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />

<Target Name="GetLatestNugetExe">

<Exec Command="$(PowerShellExe) -NonInteractive -executionpolicy Unrestricted -command (New-Object System.Net.WebClient).DownloadFile('http://dist.nuget.org/win-x86-commandline/latest/nuget.exe', 'nuget.exe')"/>

</Target>

<Target Name="RestoreControlsSolutionNuGetPackages">

<Exec Command="$(Nuget32ToolPath) restore $(UWPControlsSolutionPath) -NonInteractive -Source https://api.nuget.org/v3/index.json" />

</Target>

<Target Name="BuildControlsSolution">

<MSBuild Projects="$(UWPControlsSolutionPath)"
Properties="Configuration=$(Configuration);Platform=$(AnyCPUPlatform)"
Targets="Rebuild" />
</Target>

<Target Name="RestoreMapSolutionNuGetPackages">

<MSBuild Projects="$(UWPMapSolutionPath)" Targets="Restore" />

</Target>

<Target Name="BuildMapX86Platform">

<MSBuild Projects="$(UWPMapSolutionPath)"
Properties="Configuration=$(Configuration);Platform=$(X86Platform)"
Targets="Rebuild" />
</Target>

<Target Name="BuildMapX64Platform">

<MSBuild Projects="$(UWPMapSolutionPath)"
Properties="Configuration=$(Configuration);Platform=$(X64Platform)"
Targets="Rebuild" />

</Target>

<Target Name="BuildMapArmPlatform">

<MSBuild Projects="$(UWPMapSolutionPath)"
Properties="Configuration=$(Configuration);Platform=$(ArmPlatform)"
Targets="Rebuild" />

</Target>

<Target Name="BuildMapArm64Platform">

<MSBuild Projects="$(UWPMapSolutionPath)"
Properties="Configuration=$(Configuration);Platform=$(Arm64Platform)"
Targets="Rebuild" />

</Target>

</Project>
2 changes: 1 addition & 1 deletion BuildTools/BuildNuGet.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SET MSBUILD=%WINDIR%\microsoft.net\framework\v4.0.30319\MSBuild.exe
%MSBUILD% BuildNuget.UWP.proj /property:Version=1.0.2.2
%MSBUILD% BuildNuget.UWP.proj /property:Version=1.0.2.3
2 changes: 1 addition & 1 deletion BuildTools/BuildNuget.UWP.proj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Target Name="PrepareNugetProperties">

<PropertyGroup>
<Version Condition= " '$(Version)' == '' ">1.0.2.2</Version>
<Version Condition= " '$(Version)' == '' ">1.0.2.3</Version>
<FullPathDeployDirectory>$([System.IO.Path]::GetFullPath('$(DeployDirectory)'))</FullPathDeployDirectory>
<BinariesSubDir>$(BinariesTargetDirectory)</BinariesSubDir>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<iconUrl>http://www.telerik.com/docs/default-source/nuget-feed-product-files/nugeticon_uwp.png?sfvrsn=2</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>UI for Universal Windows Platform is a toolset for building Universal Windows Platform apps for the Windows Store and the enterprise. The library is designed to offer the same user experience, functionality and behavior on Windows devices of all form factors.</description>
<releaseNotes>For full release notes see https://github.com/telerik/UI-For-UWP/releases/tag/1.0.2.2</releaseNotes>
<releaseNotes>For full release notes see https://github.com/telerik/UI-For-UWP/releases/tag/1.0.2.3</releaseNotes>
<tags>UWP Windows Telerik Controls XAML C#</tags>
<language>en-US</language>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ internal class IndexStorage : ICollection, IEnumerable<long>, IRenderInfo
private int size;
private int count;
private object syncRoot;
private bool initializeStorageInProgress;
private bool aggregateInfoUpdateInProgress;

private long averageItemLength;
Expand Down Expand Up @@ -128,7 +129,11 @@ private long this[int index]
}

this.Set(index, value);
this.RefreshAggregateInfo();

if (!this.initializeStorageInProgress)
{
this.RefreshAggregateInfo();
}
}
}

Expand Down Expand Up @@ -415,6 +420,8 @@ private void Initialize(IRenderInfoState loadState, int capacity, long defaultVa
{
var currentValue = defaultValue;

this.initializeStorageInProgress = true;

for (int i = 0; capacity > 0; i++)
{
if (loadState != null)
Expand All @@ -428,6 +435,8 @@ private void Initialize(IRenderInfoState loadState, int capacity, long defaultVa
capacity--;
}

this.initializeStorageInProgress = false;

this.RefreshAggregateInfo();
}
}
Expand Down
129 changes: 68 additions & 61 deletions Controls/Input/Input.UWP/Calendar/View/RadCalendar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,11 @@ public event EventHandler<CurrentSelectionChangedEventArgs> SelectionChanged
}
}

/// <summary>
/// Occurs when the <see cref="DisplayMode"/> property is changed.
/// </summary>
public event EventHandler<EventArgs> DisplayModeChanged;

/// <summary>
/// Gets the <see cref="CommandService"/> instance that manages the commanding behavior of this instance.
/// </summary>
Expand Down Expand Up @@ -2207,87 +2212,87 @@ internal void UpdateNavigationHeaderContent()
return;
}

if (this.HeaderContent == null)
string headerContent = null;
switch (this.DisplayMode)
{
string headerContent = null;

switch (this.DisplayMode)
{
case CalendarDisplayMode.MonthView:
headerContent = string.Format(this.currentCulture, this.MonthViewHeaderFormat, this.DisplayDate);
break;
case CalendarDisplayMode.YearView:
headerContent = string.Format(this.currentCulture, this.YearViewHeaderFormat, this.DisplayDate);
break;
case CalendarDisplayMode.DecadeView:
DateTime decadeStart = CalendarMathHelper.GetFirstDateOfDecade(this.DisplayDate);
DateTime decadeEnd = decadeStart.AddYears(9);
case CalendarDisplayMode.MonthView:
headerContent = string.Format(this.currentCulture, this.MonthViewHeaderFormat, this.DisplayDate);
break;
case CalendarDisplayMode.YearView:
headerContent = string.Format(this.currentCulture, this.YearViewHeaderFormat, this.DisplayDate);
break;
case CalendarDisplayMode.DecadeView:
DateTime decadeStart = CalendarMathHelper.GetFirstDateOfDecade(this.DisplayDate);
DateTime decadeEnd = decadeStart.AddYears(9);

headerContent = string.Format(this.currentCulture, this.DecadeViewHeaderFormat, decadeStart, decadeEnd);
break;
case CalendarDisplayMode.CenturyView:
DateTime centuryStart = CalendarMathHelper.GetFirstDateOfCentury(this.DisplayDate);
DateTime centuryEnd = centuryStart.AddYears(99);
headerContent = string.Format(this.currentCulture, this.DecadeViewHeaderFormat, decadeStart, decadeEnd);
break;
case CalendarDisplayMode.CenturyView:
DateTime centuryStart = CalendarMathHelper.GetFirstDateOfCentury(this.DisplayDate);
DateTime centuryEnd = centuryStart.AddYears(99);

headerContent = string.Format(this.currentCulture, this.CenturyViewHeaderFormat, centuryStart, centuryEnd);
break;
case CalendarDisplayMode.MultiDayView:
string headerText = this.MultiDayViewSettings.MultiDayViewHeaderText;
if (string.IsNullOrEmpty(headerText))
headerContent = string.Format(this.currentCulture, this.CenturyViewHeaderFormat, centuryStart, centuryEnd);
break;
case CalendarDisplayMode.MultiDayView:
string headerText = this.MultiDayViewSettings.MultiDayViewHeaderText;
if (string.IsNullOrEmpty(headerText))
{
DateTime firstDateOfCurrentWeek = this.DisplayDate;
DateTime lastDayOfWeek;
int visibleDays = this.MultiDayViewSettings.VisibleDays;
if (this.MultiDayViewSettings.WeekendsVisible)
{
DateTime firstDateOfCurrentWeek = this.DisplayDate;
DateTime lastDayOfWeek;
int visibleDays = this.MultiDayViewSettings.VisibleDays;
if (this.MultiDayViewSettings.WeekendsVisible)
{
lastDayOfWeek = firstDateOfCurrentWeek.AddDays(visibleDays);
}
else
{
firstDateOfCurrentWeek = CalendarMathHelper.SetFirstAvailableBusinessDay(firstDateOfCurrentWeek, 1);
lastDayOfWeek = CalendarMathHelper.AddBusinessDays(firstDateOfCurrentWeek, visibleDays);
}
lastDayOfWeek = firstDateOfCurrentWeek.AddDays(visibleDays);
}
else
{
firstDateOfCurrentWeek = CalendarMathHelper.SetFirstAvailableBusinessDay(firstDateOfCurrentWeek, 1);
lastDayOfWeek = CalendarMathHelper.AddBusinessDays(firstDateOfCurrentWeek, visibleDays);
}

if (visibleDays == 1)
{
string format = "{0:d MMMM yyyy}";
headerContent = string.Format(this.currentCulture, format, firstDateOfCurrentWeek);
}
else
{
string format = firstDateOfCurrentWeek.Year == lastDayOfWeek.Subtract(TimeSpan.FromTicks(1)).Year ?
(firstDateOfCurrentWeek.Month == lastDayOfWeek.Subtract(TimeSpan.FromTicks(1)).Month ?
"{0:d } ~ {1:d MMMM yyyy}" :
"{0:d MMMM} ~ {1:d MMMM yyyy}") :
"{0:d MMMM yyyy} ~ {1:d MMMM yyyy}";

lastDayOfWeek = lastDayOfWeek.Subtract(TimeSpan.FromTicks(1));
if (!this.MultiDayViewSettings.WeekendsVisible)
{
lastDayOfWeek = CalendarMathHelper.SetFirstAvailableBusinessDay(lastDayOfWeek, -1);
}

headerContent = string.Format(this.currentCulture, format, firstDateOfCurrentWeek, lastDayOfWeek);
}
if (visibleDays == 1)
{
string format = "{0:d MMMM yyyy}";
headerContent = string.Format(this.currentCulture, format, firstDateOfCurrentWeek);
}
else
{
headerContent = headerText;
string format = firstDateOfCurrentWeek.Year == lastDayOfWeek.Subtract(TimeSpan.FromTicks(1)).Year ?
(firstDateOfCurrentWeek.Month == lastDayOfWeek.Subtract(TimeSpan.FromTicks(1)).Month ?
"{0:d } ~ {1:d MMMM yyyy}" :
"{0:d MMMM} ~ {1:d MMMM yyyy}") :
"{0:d MMMM yyyy} ~ {1:d MMMM yyyy}";

lastDayOfWeek = lastDayOfWeek.Subtract(TimeSpan.FromTicks(1));
if (!this.MultiDayViewSettings.WeekendsVisible)
{
lastDayOfWeek = CalendarMathHelper.SetFirstAvailableBusinessDay(lastDayOfWeek, -1);
}

headerContent = string.Format(this.currentCulture, format, firstDateOfCurrentWeek, lastDayOfWeek);
}
}
else
{
headerContent = headerText;
}

break;
}
break;
}

if (this.HeaderContent == null)
{
this.navigationPanel.HeaderContent = headerContent;
}
else
{
this.navigationPanel.HeaderContent = this.HeaderContent;
this.navigationPanel.DataContext = headerContent;
}

this.navigationPanel.HeaderContentTemplate = this.HeaderContentTemplate;
}

internal void OnCalendarButtonClicked()
{
this.FooterButtonClicked?.Invoke(this, EventArgs.Empty);
Expand Down Expand Up @@ -2681,6 +2686,8 @@ private static void OnDisplayModePropertyChanged(DependencyObject target, Depend
calendar.FetchNewAppointments();
calendar.model.multiDayViewModel.updateFlag = MultiDayViewUpdateFlag.All;
}

calendar.DisplayModeChanged?.Invoke(calendar, new EventArgs());
}

private static void OnCalendarViewHeaderFormatPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
Expand Down
Loading

0 comments on commit 6e5cae5

Please sign in to comment.