Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.

Commit 6e5cae5

Browse files
authored
Merge pull request #487 from telerik/development
Merge develoment into master
2 parents aa472be + c555c21 commit 6e5cae5

File tree

9 files changed

+198
-159
lines changed

9 files changed

+198
-159
lines changed

BuildTools/BuildControls.UWP.proj

+78-78
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,78 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
3-
4-
<Import Project="$(MSBuildProjectDirectory)\Config.UWP.proj" />
5-
6-
<PropertyGroup>
7-
<BuildDependsOn>
8-
GetLatestNugetExe;
9-
RestoreControlsSolutionNuGetPackages;
10-
BuildControlsSolution;
11-
RestoreMapSolutionNuGetPackages;
12-
BuildMapX86Platform;
13-
BuildMapX64Platform;
14-
BuildMapArmPlatform;
15-
BuildMapArm64Platform;
16-
</BuildDependsOn>
17-
</PropertyGroup>
18-
19-
20-
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />
21-
22-
<Target Name="GetLatestNugetExe">
23-
24-
<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')"/>
25-
26-
</Target>
27-
28-
<Target Name="RestoreControlsSolutionNuGetPackages">
29-
30-
<Exec Command="$(Nuget32ToolPath) restore $(UWPControlsSolutionPath) -NonInteractive -Source https://api.nuget.org/v3/index.json" />
31-
32-
</Target>
33-
34-
<Target Name="BuildControlsSolution">
35-
36-
<MSBuild Projects="$(UWPControlsSolutionPath)"
37-
Properties="Configuration=$(Configuration);Platform=$(AnyCPUPlatform)"
38-
Targets="Rebuild" />
39-
</Target>
40-
41-
<Target Name="RestoreMapSolutionNuGetPackages">
42-
43-
<MSBuild Projects="$(UWPMapSolutionPath)" Targets="Restore" />
44-
45-
</Target>
46-
47-
<Target Name="BuildMapX86Platform">
48-
49-
<MSBuild Projects="$(UWPMapSolutionPath)"
50-
Properties="Configuration=$(Configuration);Platform=$(X86Platform)"
51-
Targets="Rebuild" />
52-
</Target>
53-
54-
<Target Name="BuildMapX64Platform">
55-
56-
<MSBuild Projects="$(UWPMapSolutionPath)"
57-
Properties="Configuration=$(Configuration);Platform=$(X64Platform)"
58-
Targets="Rebuild" />
59-
60-
</Target>
61-
62-
<Target Name="BuildMapArmPlatform">
63-
64-
<MSBuild Projects="$(UWPMapSolutionPath)"
65-
Properties="Configuration=$(Configuration);Platform=$(ArmPlatform)"
66-
Targets="Rebuild" />
67-
68-
</Target>
69-
70-
<Target Name="BuildMapArm64Platform">
71-
72-
<MSBuild Projects="$(UWPMapSolutionPath)"
73-
Properties="Configuration=$(Configuration);Platform=$(Arm64Platform)"
74-
Targets="Rebuild" />
75-
76-
</Target>
77-
78-
</Project>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
3+
4+
<Import Project="$(MSBuildProjectDirectory)\Config.UWP.proj" />
5+
6+
<PropertyGroup>
7+
<BuildDependsOn>
8+
GetLatestNugetExe;
9+
RestoreControlsSolutionNuGetPackages;
10+
BuildControlsSolution;
11+
RestoreMapSolutionNuGetPackages;
12+
BuildMapX86Platform;
13+
BuildMapX64Platform;
14+
BuildMapArmPlatform;
15+
BuildMapArm64Platform;
16+
</BuildDependsOn>
17+
</PropertyGroup>
18+
19+
20+
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />
21+
22+
<Target Name="GetLatestNugetExe">
23+
24+
<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')"/>
25+
26+
</Target>
27+
28+
<Target Name="RestoreControlsSolutionNuGetPackages">
29+
30+
<Exec Command="$(Nuget32ToolPath) restore $(UWPControlsSolutionPath) -NonInteractive -Source https://api.nuget.org/v3/index.json" />
31+
32+
</Target>
33+
34+
<Target Name="BuildControlsSolution">
35+
36+
<MSBuild Projects="$(UWPControlsSolutionPath)"
37+
Properties="Configuration=$(Configuration);Platform=$(AnyCPUPlatform)"
38+
Targets="Rebuild" />
39+
</Target>
40+
41+
<Target Name="RestoreMapSolutionNuGetPackages">
42+
43+
<MSBuild Projects="$(UWPMapSolutionPath)" Targets="Restore" />
44+
45+
</Target>
46+
47+
<Target Name="BuildMapX86Platform">
48+
49+
<MSBuild Projects="$(UWPMapSolutionPath)"
50+
Properties="Configuration=$(Configuration);Platform=$(X86Platform)"
51+
Targets="Rebuild" />
52+
</Target>
53+
54+
<Target Name="BuildMapX64Platform">
55+
56+
<MSBuild Projects="$(UWPMapSolutionPath)"
57+
Properties="Configuration=$(Configuration);Platform=$(X64Platform)"
58+
Targets="Rebuild" />
59+
60+
</Target>
61+
62+
<Target Name="BuildMapArmPlatform">
63+
64+
<MSBuild Projects="$(UWPMapSolutionPath)"
65+
Properties="Configuration=$(Configuration);Platform=$(ArmPlatform)"
66+
Targets="Rebuild" />
67+
68+
</Target>
69+
70+
<Target Name="BuildMapArm64Platform">
71+
72+
<MSBuild Projects="$(UWPMapSolutionPath)"
73+
Properties="Configuration=$(Configuration);Platform=$(Arm64Platform)"
74+
Targets="Rebuild" />
75+
76+
</Target>
77+
78+
</Project>

BuildTools/BuildNuGet.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
SET MSBUILD=%WINDIR%\microsoft.net\framework\v4.0.30319\MSBuild.exe
2-
%MSBUILD% BuildNuget.UWP.proj /property:Version=1.0.2.2
2+
%MSBUILD% BuildNuget.UWP.proj /property:Version=1.0.2.3

BuildTools/BuildNuget.UWP.proj

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<Target Name="PrepareNugetProperties">
1616

1717
<PropertyGroup>
18-
<Version Condition= " '$(Version)' == '' ">1.0.2.2</Version>
18+
<Version Condition= " '$(Version)' == '' ">1.0.2.3</Version>
1919
<FullPathDeployDirectory>$([System.IO.Path]::GetFullPath('$(DeployDirectory)'))</FullPathDeployDirectory>
2020
<BinariesSubDir>$(BinariesTargetDirectory)</BinariesSubDir>
2121

BuildTools/Nuspecs.UWP/Package.UniversalWindowsPlatform.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<iconUrl>http://www.telerik.com/docs/default-source/nuget-feed-product-files/nugeticon_uwp.png?sfvrsn=2</iconUrl>
1212
<requireLicenseAcceptance>true</requireLicenseAcceptance>
1313
<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>
14-
<releaseNotes>For full release notes see https://github.com/telerik/UI-For-UWP/releases/tag/1.0.2.2</releaseNotes>
14+
<releaseNotes>For full release notes see https://github.com/telerik/UI-For-UWP/releases/tag/1.0.2.3</releaseNotes>
1515
<tags>UWP Windows Telerik Controls XAML C#</tags>
1616
<language>en-US</language>
1717
</metadata>

Controls/DataControls/DataControls.UWP/ListView/Layout/RenderInfo/IndexStorage.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ internal class IndexStorage : ICollection, IEnumerable<long>, IRenderInfo
2525
private int size;
2626
private int count;
2727
private object syncRoot;
28+
private bool initializeStorageInProgress;
2829
private bool aggregateInfoUpdateInProgress;
2930

3031
private long averageItemLength;
@@ -128,7 +129,11 @@ private long this[int index]
128129
}
129130

130131
this.Set(index, value);
131-
this.RefreshAggregateInfo();
132+
133+
if (!this.initializeStorageInProgress)
134+
{
135+
this.RefreshAggregateInfo();
136+
}
132137
}
133138
}
134139

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

423+
this.initializeStorageInProgress = true;
424+
418425
for (int i = 0; capacity > 0; i++)
419426
{
420427
if (loadState != null)
@@ -428,6 +435,8 @@ private void Initialize(IRenderInfoState loadState, int capacity, long defaultVa
428435
capacity--;
429436
}
430437

438+
this.initializeStorageInProgress = false;
439+
431440
this.RefreshAggregateInfo();
432441
}
433442
}

Controls/Input/Input.UWP/Calendar/View/RadCalendar.cs

+68-61
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,11 @@ public event EventHandler<CurrentSelectionChangedEventArgs> SelectionChanged
440440
}
441441
}
442442

443+
/// <summary>
444+
/// Occurs when the <see cref="DisplayMode"/> property is changed.
445+
/// </summary>
446+
public event EventHandler<EventArgs> DisplayModeChanged;
447+
443448
/// <summary>
444449
/// Gets the <see cref="CommandService"/> instance that manages the commanding behavior of this instance.
445450
/// </summary>
@@ -2207,87 +2212,87 @@ internal void UpdateNavigationHeaderContent()
22072212
return;
22082213
}
22092214

2210-
if (this.HeaderContent == null)
2215+
string headerContent = null;
2216+
switch (this.DisplayMode)
22112217
{
2212-
string headerContent = null;
2213-
2214-
switch (this.DisplayMode)
2215-
{
2216-
case CalendarDisplayMode.MonthView:
2217-
headerContent = string.Format(this.currentCulture, this.MonthViewHeaderFormat, this.DisplayDate);
2218-
break;
2219-
case CalendarDisplayMode.YearView:
2220-
headerContent = string.Format(this.currentCulture, this.YearViewHeaderFormat, this.DisplayDate);
2221-
break;
2222-
case CalendarDisplayMode.DecadeView:
2223-
DateTime decadeStart = CalendarMathHelper.GetFirstDateOfDecade(this.DisplayDate);
2224-
DateTime decadeEnd = decadeStart.AddYears(9);
2218+
case CalendarDisplayMode.MonthView:
2219+
headerContent = string.Format(this.currentCulture, this.MonthViewHeaderFormat, this.DisplayDate);
2220+
break;
2221+
case CalendarDisplayMode.YearView:
2222+
headerContent = string.Format(this.currentCulture, this.YearViewHeaderFormat, this.DisplayDate);
2223+
break;
2224+
case CalendarDisplayMode.DecadeView:
2225+
DateTime decadeStart = CalendarMathHelper.GetFirstDateOfDecade(this.DisplayDate);
2226+
DateTime decadeEnd = decadeStart.AddYears(9);
22252227

2226-
headerContent = string.Format(this.currentCulture, this.DecadeViewHeaderFormat, decadeStart, decadeEnd);
2227-
break;
2228-
case CalendarDisplayMode.CenturyView:
2229-
DateTime centuryStart = CalendarMathHelper.GetFirstDateOfCentury(this.DisplayDate);
2230-
DateTime centuryEnd = centuryStart.AddYears(99);
2228+
headerContent = string.Format(this.currentCulture, this.DecadeViewHeaderFormat, decadeStart, decadeEnd);
2229+
break;
2230+
case CalendarDisplayMode.CenturyView:
2231+
DateTime centuryStart = CalendarMathHelper.GetFirstDateOfCentury(this.DisplayDate);
2232+
DateTime centuryEnd = centuryStart.AddYears(99);
22312233

2232-
headerContent = string.Format(this.currentCulture, this.CenturyViewHeaderFormat, centuryStart, centuryEnd);
2233-
break;
2234-
case CalendarDisplayMode.MultiDayView:
2235-
string headerText = this.MultiDayViewSettings.MultiDayViewHeaderText;
2236-
if (string.IsNullOrEmpty(headerText))
2234+
headerContent = string.Format(this.currentCulture, this.CenturyViewHeaderFormat, centuryStart, centuryEnd);
2235+
break;
2236+
case CalendarDisplayMode.MultiDayView:
2237+
string headerText = this.MultiDayViewSettings.MultiDayViewHeaderText;
2238+
if (string.IsNullOrEmpty(headerText))
2239+
{
2240+
DateTime firstDateOfCurrentWeek = this.DisplayDate;
2241+
DateTime lastDayOfWeek;
2242+
int visibleDays = this.MultiDayViewSettings.VisibleDays;
2243+
if (this.MultiDayViewSettings.WeekendsVisible)
22372244
{
2238-
DateTime firstDateOfCurrentWeek = this.DisplayDate;
2239-
DateTime lastDayOfWeek;
2240-
int visibleDays = this.MultiDayViewSettings.VisibleDays;
2241-
if (this.MultiDayViewSettings.WeekendsVisible)
2242-
{
2243-
lastDayOfWeek = firstDateOfCurrentWeek.AddDays(visibleDays);
2244-
}
2245-
else
2246-
{
2247-
firstDateOfCurrentWeek = CalendarMathHelper.SetFirstAvailableBusinessDay(firstDateOfCurrentWeek, 1);
2248-
lastDayOfWeek = CalendarMathHelper.AddBusinessDays(firstDateOfCurrentWeek, visibleDays);
2249-
}
2245+
lastDayOfWeek = firstDateOfCurrentWeek.AddDays(visibleDays);
2246+
}
2247+
else
2248+
{
2249+
firstDateOfCurrentWeek = CalendarMathHelper.SetFirstAvailableBusinessDay(firstDateOfCurrentWeek, 1);
2250+
lastDayOfWeek = CalendarMathHelper.AddBusinessDays(firstDateOfCurrentWeek, visibleDays);
2251+
}
22502252

2251-
if (visibleDays == 1)
2252-
{
2253-
string format = "{0:d MMMM yyyy}";
2254-
headerContent = string.Format(this.currentCulture, format, firstDateOfCurrentWeek);
2255-
}
2256-
else
2257-
{
2258-
string format = firstDateOfCurrentWeek.Year == lastDayOfWeek.Subtract(TimeSpan.FromTicks(1)).Year ?
2259-
(firstDateOfCurrentWeek.Month == lastDayOfWeek.Subtract(TimeSpan.FromTicks(1)).Month ?
2260-
"{0:d } ~ {1:d MMMM yyyy}" :
2261-
"{0:d MMMM} ~ {1:d MMMM yyyy}") :
2262-
"{0:d MMMM yyyy} ~ {1:d MMMM yyyy}";
2263-
2264-
lastDayOfWeek = lastDayOfWeek.Subtract(TimeSpan.FromTicks(1));
2265-
if (!this.MultiDayViewSettings.WeekendsVisible)
2266-
{
2267-
lastDayOfWeek = CalendarMathHelper.SetFirstAvailableBusinessDay(lastDayOfWeek, -1);
2268-
}
2269-
2270-
headerContent = string.Format(this.currentCulture, format, firstDateOfCurrentWeek, lastDayOfWeek);
2271-
}
2253+
if (visibleDays == 1)
2254+
{
2255+
string format = "{0:d MMMM yyyy}";
2256+
headerContent = string.Format(this.currentCulture, format, firstDateOfCurrentWeek);
22722257
}
22732258
else
22742259
{
2275-
headerContent = headerText;
2260+
string format = firstDateOfCurrentWeek.Year == lastDayOfWeek.Subtract(TimeSpan.FromTicks(1)).Year ?
2261+
(firstDateOfCurrentWeek.Month == lastDayOfWeek.Subtract(TimeSpan.FromTicks(1)).Month ?
2262+
"{0:d } ~ {1:d MMMM yyyy}" :
2263+
"{0:d MMMM} ~ {1:d MMMM yyyy}") :
2264+
"{0:d MMMM yyyy} ~ {1:d MMMM yyyy}";
2265+
2266+
lastDayOfWeek = lastDayOfWeek.Subtract(TimeSpan.FromTicks(1));
2267+
if (!this.MultiDayViewSettings.WeekendsVisible)
2268+
{
2269+
lastDayOfWeek = CalendarMathHelper.SetFirstAvailableBusinessDay(lastDayOfWeek, -1);
2270+
}
2271+
2272+
headerContent = string.Format(this.currentCulture, format, firstDateOfCurrentWeek, lastDayOfWeek);
22762273
}
2274+
}
2275+
else
2276+
{
2277+
headerContent = headerText;
2278+
}
22772279

2278-
break;
2279-
}
2280+
break;
2281+
}
22802282

2283+
if (this.HeaderContent == null)
2284+
{
22812285
this.navigationPanel.HeaderContent = headerContent;
22822286
}
22832287
else
22842288
{
22852289
this.navigationPanel.HeaderContent = this.HeaderContent;
2290+
this.navigationPanel.DataContext = headerContent;
22862291
}
22872292

22882293
this.navigationPanel.HeaderContentTemplate = this.HeaderContentTemplate;
22892294
}
2290-
2295+
22912296
internal void OnCalendarButtonClicked()
22922297
{
22932298
this.FooterButtonClicked?.Invoke(this, EventArgs.Empty);
@@ -2681,6 +2686,8 @@ private static void OnDisplayModePropertyChanged(DependencyObject target, Depend
26812686
calendar.FetchNewAppointments();
26822687
calendar.model.multiDayViewModel.updateFlag = MultiDayViewUpdateFlag.All;
26832688
}
2689+
2690+
calendar.DisplayModeChanged?.Invoke(calendar, new EventArgs());
26842691
}
26852692

26862693
private static void OnCalendarViewHeaderFormatPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)

0 commit comments

Comments
 (0)