From b99e0634021d4d7c4d72c68b6a9c486088b283ae Mon Sep 17 00:00:00 2001 From: "Jeffrey Stall (MS)" Date: Mon, 22 Apr 2024 13:27:24 -0700 Subject: [PATCH] Fixes Fixes: 1. Updates from .NET 5 (not supported) to .NET 6 (LTS) 2. Removing UWP-only APIs 3. Fixing modern C# compiler warnings. --- .../ExpressionBuilder.csproj | 2 +- SampleGallery/SampleGallery.csproj | 2 +- .../ConnectedAnimationShell.xaml.cs | 6 +- .../CustomConnectedAnimation.xaml | 32 ----- .../CustomConnectedAnimation.xaml.cs | 120 ------------------ .../CustomConnectedAnimationDetail.cs | 112 ---------------- .../CustomConnectedAnimationDetail.xaml | 72 ----------- .../ShadowPlayground/ShadowPlayground.xaml | 12 +- .../ShadowPlayground/ShadowPlayground.xaml.cs | 5 +- .../BorderPlayground/BorderPlayground.xaml | 2 +- .../BorderPlayground/BorderPlayground.xaml.cs | 2 +- .../ShadowsAdvanced/ShadowsAdvanced.cs | 2 +- .../LinearGradients/LinearGradients.xaml.cs | 4 +- SampleGallery/Shared/AppTelemetryClient.cs | 4 +- .../SamplesCommon/SamplesCommon.csproj | 2 +- 15 files changed, 20 insertions(+), 359 deletions(-) delete mode 100644 SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimation.xaml delete mode 100644 SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimation.xaml.cs delete mode 100644 SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimationDetail.cs delete mode 100644 SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimationDetail.xaml diff --git a/ExpressionBuilder/ExpressionBuilder/ExpressionBuilder.csproj b/ExpressionBuilder/ExpressionBuilder/ExpressionBuilder.csproj index fc37a2d..8c84075 100644 --- a/ExpressionBuilder/ExpressionBuilder/ExpressionBuilder.csproj +++ b/ExpressionBuilder/ExpressionBuilder/ExpressionBuilder.csproj @@ -1,7 +1,7 @@  - net5.0-windows10.0.19041 + net6.0-windows10.0.19041.0 10.0.19041.0 10.0.18362.0 ExpressionBuilder diff --git a/SampleGallery/SampleGallery.csproj b/SampleGallery/SampleGallery.csproj index 88dc638..a0a720c 100644 --- a/SampleGallery/SampleGallery.csproj +++ b/SampleGallery/SampleGallery.csproj @@ -1,7 +1,7 @@  WinExe - net5.0-windows10.0.19041.0 + net6.0-windows10.0.19041.0 10.0.17763.0 CompositionSampleGallery app.manifest diff --git a/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/ConnectedAnimationShell.xaml.cs b/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/ConnectedAnimationShell.xaml.cs index 4e7f55a..e004f4c 100644 --- a/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/ConnectedAnimationShell.xaml.cs +++ b/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/ConnectedAnimationShell.xaml.cs @@ -29,7 +29,7 @@ namespace CompositionSampleGallery { InitializeComponent(); - SampleComboBox.ItemsSource = new[] { "XAML Connected Animation", "Custom Connected Animation" }; + SampleComboBox.ItemsSource = new[] { "XAML Connected Animation" }; SampleComboBox.SelectedIndex = 0; } @@ -39,10 +39,6 @@ namespace CompositionSampleGallery { SamplesFrame.Navigate(typeof(ConnectedAnimationSample)); } - else if (SampleComboBox.SelectedIndex == 1) - { - SamplesFrame.Navigate(typeof(CustomConnectedAnimation)); - } } } } diff --git a/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimation.xaml b/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimation.xaml deleted file mode 100644 index 79e61ca..0000000 --- a/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimation.xaml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimation.xaml.cs b/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimation.xaml.cs deleted file mode 100644 index 008e1bf..0000000 --- a/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimation.xaml.cs +++ /dev/null @@ -1,120 +0,0 @@ -//********************************************************* -// -// Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the MIT License (MIT). -// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//********************************************************* - -using SamplesCommon; - -using Windows.Foundation; - -using Microsoft.UI.Composition; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Navigation; -using CompositionSampleGallery.Shared; - -namespace CompositionSampleGallery -{ - public sealed partial class CustomConnectedAnimation : Page - { - private ConnectedTransition _currentTransition; - - public struct ContinuityData - { - public SpriteVisual sprite; - public Frame frame; - public UIElement parent; - public CompositionImage image; - } - - public struct DetailsInfo - { - public Thumbnail thumbanil; - } - - public CustomConnectedAnimation() - { - Model = new LocalDataSource(); - this.InitializeComponent(); - NavigationCacheMode = NavigationCacheMode.Enabled; - } - - public LocalDataSource Model - { - get; set; - } - - private void ThumbnailList_Click(object sender, ItemClickEventArgs e) - { - GridView gridView = (GridView)sender; - GridViewItem item = (GridViewItem)gridView.ContainerFromItem(e.ClickedItem); - CompositionImage image = VisualTreeHelperExtensions.GetFirstDescendantOfType(item); - - // We are about to transition to a new page. Cancel any outstanding transitions. - if (_currentTransition != null) - { - if (!_currentTransition.Completed) - { - _currentTransition.Cancel(); - } - _currentTransition = null; - } - - DetailsInfo info; - info.thumbanil = (Thumbnail)e.ClickedItem; - - // Setup the new transition and trigger the navigation - ConnectedTransition transition = new ConnectedTransition(); - transition.Initialize(Frame, image, info); - - Frame.Navigate(typeof(CustomConnectedAnimationDetail), transition); - } - - protected override void OnNavigatedTo(NavigationEventArgs e) - { - base.OnNavigatedTo(e); - - // Store the incoming parameter - if (e.Parameter is ConnectedTransition) - { - _currentTransition = (ConnectedTransition)e.Parameter; - } - else - { - // Should not run ConnectedTransition - _currentTransition = null; - } - - //Hide the back button on the list page as there is no where to go back to. - Windows.UI.Core.SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.Collapsed; - } - - private void ThumbnailList_Loaded(object sender, RoutedEventArgs args) - { - if (_currentTransition != null) - { - DetailsInfo info = (DetailsInfo)_currentTransition.Payload; - GridViewItem item = (GridViewItem)ThumbnailList.ContainerFromItem(info.thumbanil); - CompositionImage image = VisualTreeHelperExtensions.GetFirstDescendantOfType(item); - ScrollViewer scrollViewer = VisualTreeHelperExtensions.GetFirstDescendantOfType(ThumbnailList); - - // Kick off the transition now that the page has loaded - _currentTransition.Start(MyGrid, image, scrollViewer, ThumbnailList); - } - } - - private void Grid_SizeChanged(object sender, SizeChangedEventArgs e) - { - GridClip.Rect = new Rect(0d, 0d, e.NewSize.Width, e.NewSize.Height); - } - } -} diff --git a/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimationDetail.cs b/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimationDetail.cs deleted file mode 100644 index f50946e..0000000 --- a/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimationDetail.cs +++ /dev/null @@ -1,112 +0,0 @@ -//********************************************************* -// -// Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the MIT License (MIT). -// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//********************************************************* - -using System; -using Windows.UI.Core; - -using Windows.Foundation; - -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Navigation; - -namespace CompositionSampleGallery -{ - public sealed partial class CustomConnectedAnimationDetail : Page - { - private ConnectedTransition - _currentTransition; - private CustomConnectedAnimation.DetailsInfo - _detailsInfo; - private Frame _host; - - public CustomConnectedAnimationDetail() - { - this.InitializeComponent(); - } - - protected override void OnNavigatedTo(NavigationEventArgs e) - { - base.OnNavigatedTo(e); - - _currentTransition = (ConnectedTransition)e.Parameter; - _detailsInfo = (CustomConnectedAnimation.DetailsInfo)_currentTransition.Payload; - _host = _currentTransition.Host as Frame; - - Title.Text = _detailsInfo.thumbanil.Name; - DetailText.Text = _detailsInfo.thumbanil.Description; - - // Enable the back button - SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = _host.CanGoBack ? - AppViewBackButtonVisibility.Visible : - AppViewBackButtonVisibility.Collapsed; - - SystemNavigationManager.GetForCurrentView().BackRequested += CustomConnectedAnimationDetail_BackRequested; - } - - protected override void OnNavigatedFrom(NavigationEventArgs e) - { - base.OnNavigatedFrom(e); - - // Unregister the handler - SystemNavigationManager manager = SystemNavigationManager.GetForCurrentView(); - manager.BackRequested -= CustomConnectedAnimationDetail_BackRequested; - manager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; - } - - private void CustomConnectedAnimationDetail_BackRequested(object sender, BackRequestedEventArgs e) - { - if (!e.Handled) - { - // We are about to transition to a new page. Cancel any outstanding transitions. - if (_currentTransition != null) - { - if (!_currentTransition.Completed) - { - _currentTransition.Cancel(); - } - _currentTransition = null; - } - - // Setup the new transition and trigger the navigation - ConnectedTransition transition = new ConnectedTransition(); - transition.Initialize(_host, ThumbnailImage, _detailsInfo); - - _host.Navigate(typeof(CustomConnectedAnimation), transition); - - // We've got it handled - e.Handled = true; - } - } - - private void Page_Loaded(object sender, RoutedEventArgs e) - { - if (_currentTransition != null) - { - CustomConnectedAnimation.DetailsInfo info = (CustomConnectedAnimation.DetailsInfo)_currentTransition.Payload; - - // Update the Thumbnail image to point to the proper album art - ThumbnailImage.Source = new Uri(info.thumbanil.ImageUrl); - - // Kick off the transition now that the page has loaded - _currentTransition.Start(MyGrid, ThumbnailImage, MyScroller, MyScroller); - } - } - - private void MainGrid_SizeChanged(object sender, SizeChangedEventArgs e) - { - GridClip.Rect = new Rect(0d, 0d, e.NewSize.Width, e.NewSize.Height); - } - } -} diff --git a/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimationDetail.xaml b/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimationDetail.xaml deleted file mode 100644 index 80acd79..0000000 --- a/SampleGallery/Samples/SDK 10586/CustomConnectedAnimation/CustomConnectedAnimationDetail.xaml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec efficitur, eros sit amet laoreet scelerisque, - nunc odio ultricies metus, ut consectetur nulla massa eu nibh. Phasellus in lorem id nunc euismod tempus. Phasellus et nulla non turpis tempor blandit ut eget turpis. - Phasellus ac ornare elit, ut scelerisque dolor. Nam vel finibus lorem. Aenean malesuada pulvinar eros id ornare. Fusce blandit ante eget dolor efficitur suscipit. - Phasellus ac lacus nibh. Aenean eget blandit risus, in lacinia mi. Proin fermentum ante eros, non sollicitudin mi pretium eu. Curabitur suscipit lectus arcu, eget - pretium quam sagittis non. Mauris purus mauris, condimentum nec laoreet sit amet, imperdiet sit amet nisi. Sed interdum, urna et aliquam porta, elit velit tincidunt orci, - vitae vestibulum risus lacus at nulla. Phasellus sapien ipsum, pellentesque varius enim nec, iaculis aliquet enim. Nulla id dapibus ante. Sed hendrerit sagittis leo, commodo - fringilla ligula rutrum ut. Nullam sodales, ex ut pellentesque scelerisque, sapien nulla mattis lectus, vel ullamcorper leo enim ac mi. Sed consectetur vitae velit in consequat. - Pellentesque ac condimentum justo, at feugiat nulla. Sed ut congue neque. Nam gravida quam ac urna porttitor, ut bibendum ante mattis. Cras viverra cursus sapien, et sollicitudin - risus fringilla eget. Nulla facilisi. Duis pellentesque scelerisque nisi, facilisis malesuada massa gravida et. Vestibulum ac leo sed orci tincidunt feugiat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc id leo vestibulum, vulputate ipsum sit amet, scelerisque velit. Curabitur imperdiet justo et tortor dignissim, sit amet volutpat sem ullamcorper. Nam mollis ullamcorper tellus vitae convallis. Aliquam eleifend elit nec tincidunt pharetra. Aliquam turpis eros, mollis et nunc quis, porta molestie justo. Etiam ultrices sem non turpis imperdiet dictum. Aliquam molestie elit in urna sodales, nec luctus dui laoreet. Curabitur molestie risus vel ligula efficitur, non fringilla urna iaculis. Curabitur neque tortor, facilisis quis dictum facilisis, facilisis et ante. Sed nisl erat, semper vitae efficitur ut, congue vitae quam. Ut auctor lacus sit amet varius placerat. Sed ac tellus tempus, ultricies est quis, tempor felis. Nulla vel faucibus elit, eu tincidunt eros. Nulla blandit id nisl ut porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam suscipit tellus a mattis pulvinar. Sed et libero vel ligula elementum suscipit. Ut elementum libero at sagittis pharetra. Fusce ultrices odio sapien, a posuere est consectetur ut. - - - - - diff --git a/SampleGallery/Samples/SDK 14393/ShadowPlayground/ShadowPlayground.xaml b/SampleGallery/Samples/SDK 14393/ShadowPlayground/ShadowPlayground.xaml index ba93649..cc60908 100644 --- a/SampleGallery/Samples/SDK 14393/ShadowPlayground/ShadowPlayground.xaml +++ b/SampleGallery/Samples/SDK 14393/ShadowPlayground/ShadowPlayground.xaml @@ -34,32 +34,32 @@ Margin="10"> Blur Radius Opacity Offset - X Offset - Y Shadow Color @@ -68,7 +68,7 @@ - - - net5.0-windows10.0.19041 + net6.0-windows10.0.19041.0 10.0.18362.0 10.0.17134.0 SamplesCommon