diff --git a/BuildTools/BuildControls.UWP.proj b/BuildTools/BuildControls.UWP.proj index c52acd03..b1fb6f89 100644 --- a/BuildTools/BuildControls.UWP.proj +++ b/BuildTools/BuildControls.UWP.proj @@ -1,78 +1,78 @@ - - - - - - - - GetLatestNugetExe; - RestoreControlsSolutionNuGetPackages; - BuildControlsSolution; - RestoreMapSolutionNuGetPackages; - BuildMapX86Platform; - BuildMapX64Platform; - BuildMapArmPlatform; - BuildMapArm64Platform; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + GetLatestNugetExe; + RestoreControlsSolutionNuGetPackages; + BuildControlsSolution; + RestoreMapSolutionNuGetPackages; + BuildMapX86Platform; + BuildMapX64Platform; + BuildMapArmPlatform; + BuildMapArm64Platform; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BuildTools/BuildNuGet.bat b/BuildTools/BuildNuGet.bat index de44eede..7afea25f 100644 --- a/BuildTools/BuildNuGet.bat +++ b/BuildTools/BuildNuGet.bat @@ -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 \ No newline at end of file +%MSBUILD% BuildNuget.UWP.proj /property:Version=1.0.2.3 \ No newline at end of file diff --git a/BuildTools/BuildNuget.UWP.proj b/BuildTools/BuildNuget.UWP.proj index a86b5aaa..36bcdb2c 100644 --- a/BuildTools/BuildNuget.UWP.proj +++ b/BuildTools/BuildNuget.UWP.proj @@ -15,7 +15,7 @@ - 1.0.2.2 + 1.0.2.3 $([System.IO.Path]::GetFullPath('$(DeployDirectory)')) $(BinariesTargetDirectory) diff --git a/BuildTools/Nuspecs.UWP/Package.UniversalWindowsPlatform.nuspec b/BuildTools/Nuspecs.UWP/Package.UniversalWindowsPlatform.nuspec index 78f009d2..cf7a843c 100644 --- a/BuildTools/Nuspecs.UWP/Package.UniversalWindowsPlatform.nuspec +++ b/BuildTools/Nuspecs.UWP/Package.UniversalWindowsPlatform.nuspec @@ -11,7 +11,7 @@ http://www.telerik.com/docs/default-source/nuget-feed-product-files/nugeticon_uwp.png?sfvrsn=2 true 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. - For full release notes see https://github.com/telerik/UI-For-UWP/releases/tag/1.0.2.2 + For full release notes see https://github.com/telerik/UI-For-UWP/releases/tag/1.0.2.3 UWP Windows Telerik Controls XAML C# en-US diff --git a/Controls/DataControls/DataControls.UWP/ListView/Layout/RenderInfo/IndexStorage.cs b/Controls/DataControls/DataControls.UWP/ListView/Layout/RenderInfo/IndexStorage.cs index 4ab9ac38..b9f725ca 100644 --- a/Controls/DataControls/DataControls.UWP/ListView/Layout/RenderInfo/IndexStorage.cs +++ b/Controls/DataControls/DataControls.UWP/ListView/Layout/RenderInfo/IndexStorage.cs @@ -25,6 +25,7 @@ internal class IndexStorage : ICollection, IEnumerable, IRenderInfo private int size; private int count; private object syncRoot; + private bool initializeStorageInProgress; private bool aggregateInfoUpdateInProgress; private long averageItemLength; @@ -128,7 +129,11 @@ private long this[int index] } this.Set(index, value); - this.RefreshAggregateInfo(); + + if (!this.initializeStorageInProgress) + { + this.RefreshAggregateInfo(); + } } } @@ -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) @@ -428,6 +435,8 @@ private void Initialize(IRenderInfoState loadState, int capacity, long defaultVa capacity--; } + this.initializeStorageInProgress = false; + this.RefreshAggregateInfo(); } } diff --git a/Controls/Input/Input.UWP/Calendar/View/RadCalendar.cs b/Controls/Input/Input.UWP/Calendar/View/RadCalendar.cs index b1c6a83c..3e14d333 100644 --- a/Controls/Input/Input.UWP/Calendar/View/RadCalendar.cs +++ b/Controls/Input/Input.UWP/Calendar/View/RadCalendar.cs @@ -440,6 +440,11 @@ public event EventHandler SelectionChanged } } + /// + /// Occurs when the property is changed. + /// + public event EventHandler DisplayModeChanged; + /// /// Gets the instance that manages the commanding behavior of this instance. /// @@ -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); @@ -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) diff --git a/Controls/Primitives/Primitives.UWP/SideDrawer/Commands/AnimationContext.cs b/Controls/Primitives/Primitives.UWP/SideDrawer/Commands/AnimationContext.cs index 0a67cea8..460b3ce2 100644 --- a/Controls/Primitives/Primitives.UWP/SideDrawer/Commands/AnimationContext.cs +++ b/Controls/Primitives/Primitives.UWP/SideDrawer/Commands/AnimationContext.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Xaml.Media.Animation; +using Windows.UI.Xaml.Media.Animation; namespace Telerik.UI.Xaml.Controls.Primitives.SideDrawer.Commands { @@ -32,6 +27,10 @@ public class AnimationContext /// public Storyboard DrawerStoryBoardReverse { get; set; } + internal DrawerLocation DrawerLocation { get; set; } + + internal DrawerTransition DrawerTransition { get; set; } + internal bool IsGenerated { get @@ -39,5 +38,10 @@ internal bool IsGenerated return this.MainContentStoryBoard != null && this.MainContentStoryBoardReverse != null && this.DrawerStoryBoard != null && this.DrawerStoryBoardReverse != null; } } + + internal bool IsValid(DrawerLocation location, DrawerTransition transition) + { + return this.IsGenerated && this.DrawerLocation == location && this.DrawerTransition == transition; + } } } diff --git a/Controls/Primitives/Primitives.UWP/SideDrawer/RadSideDrawer.AnimationGenerator.cs b/Controls/Primitives/Primitives.UWP/SideDrawer/RadSideDrawer.AnimationGenerator.cs index eedecb39..a6bf0196 100644 --- a/Controls/Primitives/Primitives.UWP/SideDrawer/RadSideDrawer.AnimationGenerator.cs +++ b/Controls/Primitives/Primitives.UWP/SideDrawer/RadSideDrawer.AnimationGenerator.cs @@ -66,7 +66,7 @@ internal AnimationContext GetAnimations(bool shouldPrepareDrawer = true) return this.GetSlideAlongAnimations(); default: - return new AnimationContext(); + return new AnimationContext() { DrawerLocation = this.DrawerLocation, DrawerTransition = this.DrawerTransition }; } } @@ -165,7 +165,9 @@ private AnimationContext GetPushAnimations() MainContentStoryBoard = this.mainContentStoryboard, MainContentStoryBoardReverse = this.mainContentStoryboardReverse, DrawerStoryBoardReverse = this.sideBarStoryboardReverse, - DrawerStoryBoard = this.sideBarStoryboard + DrawerStoryBoard = this.sideBarStoryboard, + DrawerLocation = this.DrawerLocation, + DrawerTransition = this.DrawerTransition }; } @@ -259,7 +261,9 @@ private AnimationContext GetRevealAnimations() MainContentStoryBoard = this.mainContentStoryboard, MainContentStoryBoardReverse = this.mainContentStoryboardReverse, DrawerStoryBoardReverse = this.sideBarStoryboardReverse, - DrawerStoryBoard = this.sideBarStoryboard + DrawerStoryBoard = this.sideBarStoryboard, + DrawerLocation = this.DrawerLocation, + DrawerTransition = this.DrawerTransition }; } @@ -400,7 +404,9 @@ private AnimationContext GetReverseSlideOutAnimations() MainContentStoryBoard = this.mainContentStoryboard, MainContentStoryBoardReverse = this.mainContentStoryboardReverse, DrawerStoryBoardReverse = this.sideBarStoryboardReverse, - DrawerStoryBoard = this.sideBarStoryboard + DrawerStoryBoard = this.sideBarStoryboard, + DrawerLocation = this.DrawerLocation, + DrawerTransition = this.DrawerTransition }; } @@ -509,7 +515,9 @@ private AnimationContext GetScaleDownPusherAnimations() MainContentStoryBoard = this.mainContentStoryboard, MainContentStoryBoardReverse = this.mainContentStoryboardReverse, DrawerStoryBoardReverse = this.sideBarStoryboardReverse, - DrawerStoryBoard = this.sideBarStoryboard + DrawerStoryBoard = this.sideBarStoryboard, + DrawerLocation = this.DrawerLocation, + DrawerTransition = this.DrawerTransition }; } @@ -651,7 +659,9 @@ private AnimationContext GetScaleUpAnimations() MainContentStoryBoard = this.mainContentStoryboard, MainContentStoryBoardReverse = this.mainContentStoryboardReverse, DrawerStoryBoardReverse = this.sideBarStoryboardReverse, - DrawerStoryBoard = this.sideBarStoryboard + DrawerStoryBoard = this.sideBarStoryboard, + DrawerLocation = this.DrawerLocation, + DrawerTransition = this.DrawerTransition }; } @@ -718,7 +728,9 @@ private AnimationContext GetSlideInOnTopAnimations() MainContentStoryBoard = this.mainContentStoryboard, MainContentStoryBoardReverse = this.mainContentStoryboardReverse, DrawerStoryBoardReverse = this.sideBarStoryboardReverse, - DrawerStoryBoard = this.sideBarStoryboard + DrawerStoryBoard = this.sideBarStoryboard, + DrawerLocation = this.DrawerLocation, + DrawerTransition = this.DrawerTransition }; } @@ -842,7 +854,9 @@ private AnimationContext GetSlideAlongAnimations() MainContentStoryBoard = this.mainContentStoryboard, MainContentStoryBoardReverse = this.mainContentStoryboardReverse, DrawerStoryBoardReverse = this.sideBarStoryboardReverse, - DrawerStoryBoard = this.sideBarStoryboard + DrawerStoryBoard = this.sideBarStoryboard, + DrawerLocation = this.DrawerLocation, + DrawerTransition = this.DrawerTransition }; } diff --git a/Controls/Primitives/Primitives.UWP/SideDrawer/RadSideDrawer.cs b/Controls/Primitives/Primitives.UWP/SideDrawer/RadSideDrawer.cs index 4af23b79..d33fedb2 100644 --- a/Controls/Primitives/Primitives.UWP/SideDrawer/RadSideDrawer.cs +++ b/Controls/Primitives/Primitives.UWP/SideDrawer/RadSideDrawer.cs @@ -428,6 +428,11 @@ public void ShowDrawer() return; } + if (!this.Context.IsValid(this.DrawerLocation, this.DrawerTransition)) + { + this.UpdateLayout(); + } + if (this.DrawerState == DrawerState.Closed) { this.Context.MainContentStoryBoard.Begin(); @@ -674,7 +679,7 @@ protected override AutomationPeer OnCreateAutomationPeer() private static void OnDrawerTransitionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var sideDrawer = d as RadSideDrawer; - if (sideDrawer.drawer != null) + if (sideDrawer.drawer != null && (DrawerTransition)e.NewValue != (DrawerTransition)e.OldValue) { sideDrawer.ResetDrawer(); } @@ -720,7 +725,7 @@ private static void OnDrawerStateChanged(DependencyObject d, DependencyPropertyC private static void OnDrawerLocationChagned(DependencyObject d, DependencyPropertyChangedEventArgs e) { var sideDrawer = d as RadSideDrawer; - if (sideDrawer.drawer != null) + if (sideDrawer.drawer != null && (DrawerLocation)e.NewValue != (DrawerLocation)e.OldValue) { sideDrawer.ResetDrawer(); }