Skip to content

Commit

Permalink
Merge pull request #1336 from microsoft/scottj1s/version_info_dupe_wa…
Browse files Browse the repository at this point in the history
…rning

Update to WASDK 1.4 and related maintenance
  • Loading branch information
Scottj1s authored Aug 30, 2023
2 parents 3aa928b + 73c093d commit a696058
Show file tree
Hide file tree
Showing 15 changed files with 284 additions and 383 deletions.
5 changes: 3 additions & 2 deletions UITests/AxeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ public static void AssertNoAccessibilityErrors()
var testResult = AccessibilityScanner.Scan(null).WindowScanOutputs.SelectMany(output => output.Errors)
.Where(rule => rule.Rule.ID != RuleId.NameIsInformative)
.Where(rule => rule.Rule.ID != RuleId.NameExcludesControlType)
.Where(rule => rule.Rule.ID != RuleId.NameExcludesLocalizedControlType);
if (testResult.Any())
.Where(rule => rule.Rule.ID != RuleId.NameExcludesLocalizedControlType)
.Where(rule => rule.Rule.ID != RuleId.SiblingUniqueAndFocusable);
if (testResult.Any())
{
var mappedResult = testResult.Select(result => "Element " + result.Element.Properties["ControlType"] + " violated rule '" + result.Rule.Description + "'.");
Assert.Fail("Failed with the following accessibility errors \r\n" + string.Join("\r\n", mappedResult));
Expand Down
5 changes: 3 additions & 2 deletions WinUIGallery/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ sealed partial class App : Application

public static string WinAppSdkDetails
{
get => string.Format("Windows App SDK {0}.{1}.{2}{3}",
WASDK.Release.Major, WASDK.Release.Minor, WASDK.Release.Patch, WASDK.Release.FormattedVersionTag);
// TODO: restore patch number and version tag when WinAppSDK supports them both
get => string.Format("Windows App SDK {0}.{1}",
WASDK.Release.Major, WASDK.Release.Minor);
}

public static string WinAppSdkRuntimeDetails
Expand Down
6 changes: 3 additions & 3 deletions WinUIGallery/ControlPages/MenuBarPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
XamlSource="MenuBar\MenuBarSample1.txt">
<StackPanel>
<TextBlock x:Name="SelectedOptionText" Text="" />
<MenuBar x:Name="Example1">
<MenuBar LayoutUpdated="MenuBar_LayoutUpdated" x:Name="Example1">
<MenuBarItem Title="File">
<MenuFlyoutItem x:Name="o1" Text="New" Click="OnElementClicked"/>
<MenuFlyoutItem x:Name="o2" Text="Open" Click="OnElementClicked"/>
Expand All @@ -38,7 +38,7 @@
XamlSource="Menubar\MenuBarSample3.txt">
<StackPanel>
<TextBlock x:Name="SelectedOptionText1" Text="" />
<MenuBar x:Name="Example2">
<MenuBar LayoutUpdated="MenuBar_LayoutUpdated" x:Name="Example2">
<MenuBarItem Title="File">
<MenuFlyoutItem x:Name ="t2" Text="New" Click="OnElementClicked">
<MenuFlyoutItem.KeyboardAccelerators>
Expand Down Expand Up @@ -101,7 +101,7 @@
XamlSource="MenuBar\MenuBarSample2.txt">
<StackPanel>
<TextBlock x:Name="SelectedOptionText2" Text="" />
<MenuBar x:Name="Example3">
<MenuBar LayoutUpdated="MenuBar_LayoutUpdated" x:Name="Example3">
<MenuBarItem Title="File">
<MenuFlyoutSubItem Text="New">
<MenuFlyoutItem x:Name="z1" Text="Plain Text Document" Click="OnElementClicked"/>
Expand Down
14 changes: 12 additions & 2 deletions WinUIGallery/ControlPages/MenuBarPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using AppUIBasics.Helper;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -38,6 +39,15 @@ private void OnElementClicked(object sender, Microsoft.UI.Xaml.RoutedEventArgs e
{
SelectedOptionText2.Text = "You clicked: " + (sender as MenuFlyoutItem).Text;
}
}
}

// Workaround for known issue with menu themes in WinAppSDK 1.4 (#8678, #8756)
private void MenuBar_LayoutUpdated(object sender, object e)
{
foreach (var popup in VisualTreeHelper.GetOpenPopupsForXamlRoot(this.XamlRoot))
{
popup.RequestedTheme = ThemeHelper.RootTheme;
}
}
}
}
12 changes: 6 additions & 6 deletions WinUIGallery/ControlPages/MenuFlyoutPage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
Expand All @@ -19,7 +19,7 @@
<StackPanel x:Name="Control1" Orientation="Horizontal">
<AppBarButton Icon="Sort" IsCompact="True" ToolTipService.ToolTip="Sort" AutomationProperties.Name="Sort">
<Button.Flyout>
<MenuFlyout>
<MenuFlyout Opened="MenuFlyout_Opened">
<MenuFlyoutItem Text="By rating" Click="MenuFlyoutItem_Click" Tag="rating" />
<MenuFlyoutItem Text="By match" Click="MenuFlyoutItem_Click" Tag="match" />
<MenuFlyoutItem Text="By distance" Click="MenuFlyoutItem_Click" Tag="distance" />
Expand All @@ -46,7 +46,7 @@
HeaderText="A MenuFlyout with ToggleMenuFlyoutItems and MenuFlyoutSeparator.">
<Button x:Name="Control2" Content="Options">
<Button.Flyout>
<MenuFlyout>
<MenuFlyout Opened="MenuFlyout_Opened">
<MenuFlyoutItem Text="Reset" />
<MenuFlyoutSeparator />
<ToggleMenuFlyoutItem x:Name="RepeatToggleMenuFlyoutItem" Text="Repeat" IsChecked="True" />
Expand Down Expand Up @@ -76,7 +76,7 @@
<local:ControlExample x:Name="Example3" HeaderText="A MenuFlyout with cascading menus.">
<Button x:Name="Control3" Content="File Options">
<Button.Flyout>
<MenuFlyout>
<MenuFlyout Opened="MenuFlyout_Opened">
<MenuFlyoutItem Text="Open" />
<MenuFlyoutSubItem Text="Send to">
<MenuFlyoutItem Text="Bluetooth" />
Expand Down Expand Up @@ -115,7 +115,7 @@
HeaderText="A MenuFlyout with icons.">
<Button x:Name="Control4" Content="Edit Options">
<Button.Flyout>
<MenuFlyout>
<MenuFlyout Opened="MenuFlyout_Opened">
<MenuFlyoutItem Text="Share">
<MenuFlyoutItem.Icon>
<FontIcon Glyph="&#xE72D;" />
Expand Down Expand Up @@ -154,7 +154,7 @@
HeaderText="A MenuFlyout with icons and Keyboard Accelerators." FontFamily="Segoe UI" Loaded="Example5_Loaded">
<Button x:Name="Control5" Content="Edit Options">
<Button.Flyout>
<MenuFlyout>
<MenuFlyout Opened="MenuFlyout_Opened">
<MenuFlyoutItem Text="Share">
<MenuFlyoutItem.Icon>
<FontIcon Glyph="&#xE72D;" />
Expand Down
15 changes: 13 additions & 2 deletions WinUIGallery/ControlPages/MenuFlyoutPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//*********************************************************
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
Expand All @@ -7,10 +7,12 @@
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
using AppUIBasics.Helper;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;

namespace AppUIBasics.ControlPages
{
Expand Down Expand Up @@ -45,6 +47,15 @@ private void MenuFlyoutItem_Click(object sender, RoutedEventArgs e)
private void Example5_Loaded(object sender, RoutedEventArgs e)
{

}
}

// Workaround for known issue with menu themes in WinAppSDK 1.4 (#8678, #8756)
private void MenuFlyout_Opened(object sender, object e)
{
foreach (var popup in VisualTreeHelper.GetOpenPopupsForXamlRoot(this.XamlRoot))
{
popup.RequestedTheme = ThemeHelper.RootTheme;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishAppxPackage>False</PublishAppxPackage>
<PublishTrimmed>True</PublishTrimmed>
<PublishReadyToRun>$(Optimized)</PublishReadyToRun>
<PublishTrimmed>$(Optimized)</PublishTrimmed>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions WinUIGallery/Properties/PublishProfiles/win10-arm64.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishAppxPackage>True</PublishAppxPackage>
<PublishTrimmed>True</PublishTrimmed>
<PublishReadyToRun>$(Optimized)</PublishReadyToRun>
<PublishTrimmed>$(Optimized)</PublishTrimmed>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishAppxPackage>False</PublishAppxPackage>
<PublishTrimmed>True</PublishTrimmed>
<PublishReadyToRun>$(Optimized)</PublishReadyToRun>
<PublishTrimmed>$(Optimized)</PublishTrimmed>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions WinUIGallery/Properties/PublishProfiles/win10-x64.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishAppxPackage>True</PublishAppxPackage>
<PublishTrimmed>True</PublishTrimmed>
<PublishReadyToRun>$(Optimized)</PublishReadyToRun>
<PublishTrimmed>$(Optimized)</PublishTrimmed>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<RuntimeIdentifier>win10-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishAppxPackage>False</PublishAppxPackage>
<PublishTrimmed>True</PublishTrimmed>
<PublishReadyToRun>$(Optimized)</PublishReadyToRun>
<PublishTrimmed>$(Optimized)</PublishTrimmed>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions WinUIGallery/Properties/PublishProfiles/win10-x86.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<RuntimeIdentifier>win10-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishAppxPackage>True</PublishAppxPackage>
<PublishTrimmed>True</PublishTrimmed>
<PublishReadyToRun>$(Optimized)</PublishReadyToRun>
<PublishTrimmed>$(Optimized)</PublishTrimmed>
</PropertyGroup>
</Project>
112 changes: 0 additions & 112 deletions WinUIGallery/WinUIGallery.DesktopWap.Package.wapproj

This file was deleted.

Loading

0 comments on commit a696058

Please sign in to comment.