diff --git a/eng/devices/android.cake b/eng/devices/android.cake index 2fcbadd7ad10..76de2b060374 100644 --- a/eng/devices/android.cake +++ b/eng/devices/android.cake @@ -328,8 +328,8 @@ void ExecuteUITests(string project, string app, string appPackageName, string de var name = System.IO.Path.GetFileNameWithoutExtension(project); var binlog = $"{binDir}/{name}-{config}-{platform}.binlog"; - var appiumLog = $"{binDir}/appium_{platform}.log"; var resultsFileName = SanitizeTestResultsFilename($"{name}-{config}-{platform}-{testFilter}"); + var appiumLog = $"{binDir}/appium_{platform}_{resultsFileName}.log"; DotNetBuild(project, new DotNetBuildSettings { diff --git a/eng/devices/catalyst.cake b/eng/devices/catalyst.cake index 0cec737d21d1..a35cdff5a5ed 100644 --- a/eng/devices/catalyst.cake +++ b/eng/devices/catalyst.cake @@ -140,8 +140,8 @@ void ExecuteUITests(string project, string app, string device, string resultsDir var name = System.IO.Path.GetFileNameWithoutExtension(project); var binlog = $"{binDir}/{name}-{config}-mac.binlog"; - var appiumLog = $"{binDir}/appium_mac.log"; var resultsFileName = SanitizeTestResultsFilename($"{name}-{config}-catalyst-{testFilter}"); + var appiumLog = $"{binDir}/appium_mac_{resultsFileName}.log"; DotNetBuild(project, new DotNetBuildSettings { diff --git a/eng/devices/ios.cake b/eng/devices/ios.cake index c4b2eba3098b..1e1517b9a8cb 100644 --- a/eng/devices/ios.cake +++ b/eng/devices/ios.cake @@ -49,8 +49,8 @@ Setup(context => { return; } - - PerformCleanupIfNeeded(deviceCleanupEnabled, false); + bool createLogs = targetCleanup && IsCIBuild(); + PerformCleanupIfNeeded(deviceCleanupEnabled, createLogs); // Device or simulator setup if (testDevice.Contains("device")) @@ -234,8 +234,8 @@ void ExecuteUITests(string project, string app, string device, string resultsDir var name = System.IO.Path.GetFileNameWithoutExtension(project); var binlog = $"{binDir}/{name}-{config}-ios.binlog"; - var appiumLog = $"{binDir}/appium_ios.log"; var resultsFileName = SanitizeTestResultsFilename($"{name}-{config}-ios-{testFilter}"); + var appiumLog = $"{binDir}/appium_ios_{resultsFileName}.log"; DotNetBuild(project, new DotNetBuildSettings { diff --git a/eng/devices/uitests-shared.cake b/eng/devices/uitests-shared.cake index a831b293ae24..b224cee4e61c 100644 --- a/eng/devices/uitests-shared.cake +++ b/eng/devices/uitests-shared.cake @@ -10,4 +10,5 @@ if (!IsCIBuild() && GetBuildVariable("workloads", "notset") == "notset") bool deviceBoot = Argument("boot", TARGET.ToLower() != "uitest-build"); bool targetBoot = TARGET.ToLower() == "boot"; +bool targetCleanup = TARGET.ToLower() == "cleanup"; bool deviceBootWait = Argument("wait", true); \ No newline at end of file diff --git a/eng/devices/windows.cake b/eng/devices/windows.cake index 93b000281274..12591722040b 100644 --- a/eng/devices/windows.cake +++ b/eng/devices/windows.cake @@ -551,7 +551,7 @@ Task("uitest") DotNetBuild(PROJECT.FullPath, buildSettings); SetEnvironmentVariable("WINDOWS_APP_PATH", TEST_APP); - SetEnvironmentVariable("APPIUM_LOG_FILE", $"{BINLOG_DIR}/appium_windows.log"); + SetEnvironmentVariable("APPIUM_LOG_FILE", $"{BINLOG_DIR}/appium_windows_{name}.log"); Information("Run UITests project {0}",PROJECT.FullPath); RunTestWithLocalDotNet(PROJECT.FullPath, CONFIGURATION, localToolPath, noBuild: true, resultsFileNameWithoutExtension: $"{name}-{CONFIGURATION}-windows"); diff --git a/eng/pipelines/common/maui-templates.yml b/eng/pipelines/common/maui-templates.yml index 6bc2fe51e4f5..1dcd1be6e16e 100644 --- a/eng/pipelines/common/maui-templates.yml +++ b/eng/pipelines/common/maui-templates.yml @@ -24,12 +24,12 @@ parameters: - name: BuildCategories type: object default: - - WindowsTemplates - - macOSTemplates - - Build - - Blazor - - MultiProject - - AOT + - WindowsTemplates + - macOSTemplates + - Build + - Blazor + - MultiProject + - AOT - name: RunPlatforms type: object @@ -119,6 +119,14 @@ jobs: continueOnError: true condition: succeededOrFailed() + - task: PublishBuildArtifacts@1 + displayName: Publish Artifacts + condition: always() + continueOnError: true + inputs: + PathToPublish: '$(Build.StagingDirectory)/IntegrationTestsBuildLogs' + ArtifactName: BuildTemplateBuildLogs + - task: PublishTestResults@2 displayName: Publish the $(PLATFORM_NAME) templates build tests condition: always() diff --git a/eng/pipelines/common/ui-tests.yml b/eng/pipelines/common/ui-tests.yml index 16d1ab574bfc..b1c3bb778d47 100644 --- a/eng/pipelines/common/ui-tests.yml +++ b/eng/pipelines/common/ui-tests.yml @@ -56,21 +56,22 @@ stages: parameters: runtimeVariant: "Mono" - - stage: build_ui_tests_nativeaot - displayName: Build UITests Sample App NativeAOT - dependsOn: [] - jobs: - - job: build_ui_tests - displayName: Build Sample App - pool: ${{ parameters.androidPool }} - variables: - REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) - APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/ - steps: - - template: ui-tests-build-sample.yml - parameters: - runtimeVariant: "NativeAOT" - platform: ios + - ${{ if or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv'))) }}: + - stage: build_ui_tests_nativeaot + displayName: Build UITests Sample App NativeAOT + dependsOn: [] + jobs: + - job: build_ui_tests + displayName: Build Sample App + pool: ${{ parameters.androidPool }} + variables: + REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) + APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/ + steps: + - template: ui-tests-build-sample.yml + parameters: + runtimeVariant: "NativeAOT" + platform: ios - stage: build_ui_tests_windows displayName: Build UITests Windows Sample App @@ -165,47 +166,47 @@ stages: runtimeVariant : "Mono" testFilter: $(CATEGORYGROUP) - - - stage: ios_ui_tests_nativeaot - displayName: iOS UITests NativeAOT - dependsOn: build_ui_tests_nativeaot - jobs: - - ${{ each project in parameters.projects }}: - - ${{ if ne(project.ios, '') }}: - - ${{ each version in parameters.iosVersions }}: - - ${{ if not(containsValue(project.iosVersionsExclude, version)) }}: - - job: ios_ui_tests_nativeaot_${{ project.name }}_${{ replace(version, '.', '_') }} - strategy: - matrix: - ${{ each categoryGroup in parameters.categoryGroupsToTest }}: - ${{ categoryGroup }}: - CATEGORYGROUP: ${{ categoryGroup }} - timeoutInMinutes: 240 # how long to run the job before automatically cancelling - workspace: - clean: all - displayName: ${{ coalesce(project.desc, project.name) }} (v${{ version }}) - pool: ${{ parameters.iosPool }} - variables: - REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) - APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/ - steps: - - template: ui-tests-steps.yml - parameters: - platform: ios - ${{ if eq(version, 'latest') }}: - version: 17.2 - ${{ if ne(version, 'latest') }}: - version: ${{ version }} - path: ${{ project.ios }} - app: ${{ project.app }} - ${{ if eq(version, 'latest') }}: - device: ios-simulator-64 - ${{ if ne(version, 'latest') }}: - device: ios-simulator-64_${{ version }} - provisionatorChannel: ${{ parameters.provisionatorChannel }} - agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} - runtimeVariant : "NativeAOT" - testFilter: $(CATEGORYGROUP) + - ${{ if or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv'))) }}: + - stage: ios_ui_tests_nativeaot + displayName: iOS UITests NativeAOT + dependsOn: build_ui_tests_nativeaot + jobs: + - ${{ each project in parameters.projects }}: + - ${{ if ne(project.ios, '') }}: + - ${{ each version in parameters.iosVersions }}: + - ${{ if not(containsValue(project.iosVersionsExclude, version)) }}: + - job: ios_ui_tests_nativeaot_${{ project.name }}_${{ replace(version, '.', '_') }} + strategy: + matrix: + ${{ each categoryGroup in parameters.categoryGroupsToTest }}: + ${{ categoryGroup }}: + CATEGORYGROUP: ${{ categoryGroup }} + timeoutInMinutes: 240 # how long to run the job before automatically cancelling + workspace: + clean: all + displayName: ${{ coalesce(project.desc, project.name) }} (v${{ version }}) + pool: ${{ parameters.iosPool }} + variables: + REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) + APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/ + steps: + - template: ui-tests-steps.yml + parameters: + platform: ios + ${{ if eq(version, 'latest') }}: + version: 17.2 + ${{ if ne(version, 'latest') }}: + version: ${{ version }} + path: ${{ project.ios }} + app: ${{ project.app }} + ${{ if eq(version, 'latest') }}: + device: ios-simulator-64 + ${{ if ne(version, 'latest') }}: + device: ios-simulator-64_${{ version }} + provisionatorChannel: ${{ parameters.provisionatorChannel }} + agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} + runtimeVariant : "NativeAOT" + testFilter: $(CATEGORYGROUP) - stage: winui_ui_tests displayName: WinUI UITests diff --git a/src/Compatibility/ControlGallery/src/WinUI/Compatibility.ControlGallery.WinUI.csproj b/src/Compatibility/ControlGallery/src/WinUI/Compatibility.ControlGallery.WinUI.csproj index 242f283cf36e..4d7b749f7c41 100644 --- a/src/Compatibility/ControlGallery/src/WinUI/Compatibility.ControlGallery.WinUI.csproj +++ b/src/Compatibility/ControlGallery/src/WinUI/Compatibility.ControlGallery.WinUI.csproj @@ -1,4 +1,4 @@ - + diff --git a/src/Controls/src/Build.Tasks/CompiledMarkupExtensions/StaticResourceExtension.cs b/src/Controls/src/Build.Tasks/CompiledMarkupExtensions/StaticResourceExtension.cs index a78664dd4997..1ae7e6c637f4 100644 --- a/src/Controls/src/Build.Tasks/CompiledMarkupExtensions/StaticResourceExtension.cs +++ b/src/Controls/src/Build.Tasks/CompiledMarkupExtensions/StaticResourceExtension.cs @@ -93,7 +93,7 @@ public IEnumerable ProvideValue(VariableDefinitionReference vardefr //Fallback - foreach (var instruction in FallBack(keyValueNode.Value as string, eNode, module, context).ToList()) + foreach (var instruction in FallBack(keyValueNode.Value as string, eNode, module, context).ToList()) yield return instruction; var vardef = new VariableDefinition(module.TypeSystem.Object); @@ -124,15 +124,21 @@ public static IEnumerable TryConvert(ValueNode stringResourceNode, var propertyRef = parentType.GetProperty(context.Cache, pd => pd.Name == localName, out var declaringTypeReference); if (propertyRef != null) { - foreach (var instruction in stringResourceNode.PushConvertedValue(context, propertyRef.PropertyType, new ICustomAttributeProvider[] { propertyRef, propertyRef.PropertyType.ResolveCached(context.Cache) }, requiredServices => stringResourceNode.PushServiceProvider(context, requiredServices, propertyRef: propertyRef), true, false)) + var propertyType = propertyRef.PropertyType.ResolveGenericParameters(declaringTypeReference); + + foreach (var instruction in stringResourceNode.PushConvertedValue( + context, + propertyType, + [propertyRef, propertyType.ResolveCached(context.Cache)], + requiredServices => stringResourceNode.PushServiceProvider(context, requiredServices, propertyRef: propertyRef), + boxValueTypes: true, + unboxValueTypes: false)) yield return instruction; - var vardef = new VariableDefinition(propertyRef.PropertyType); + var vardef = new VariableDefinition(propertyType); yield return Create(Stloc, vardef); vardefref.VariableDefinition = vardef; yield break; } - - } public static IEnumerable FallBack(string key, IElementNode node, ModuleDefinition module, ILContext context) diff --git a/src/Controls/src/Build.Tasks/CreateObjectVisitor.cs b/src/Controls/src/Build.Tasks/CreateObjectVisitor.cs index 4e58dbf878a9..58548ff40913 100644 --- a/src/Controls/src/Build.Tasks/CreateObjectVisitor.cs +++ b/src/Controls/src/Build.Tasks/CreateObjectVisitor.cs @@ -124,17 +124,6 @@ public void Visit(ElementNode node, INode parentNode) return; } - if (IsXaml2009LanguagePrimitive(node)) - { - var vardef = new VariableDefinition(typeref); - Context.Variables[node] = vardef; - Context.Body.Variables.Add(vardef); - - Context.IL.Append(PushValueFromLanguagePrimitive(typedef, node)); - Context.IL.Emit(Stloc, vardef); - return; - } - MethodDefinition factoryCtorInfo = null; MethodDefinition factoryMethodInfo = null; MethodDefinition parameterizedCtorInfo = null; @@ -214,7 +203,7 @@ public void Visit(ElementNode node, INode parentNode) (vardef.VariableType.IsValueType || isColor)) { //Purple - Context.IL.Append(vnode.PushConvertedValue(Context, typeref, new ICustomAttributeProvider[] { typedef }, + Context.IL.Append(vnode.PushConvertedValue(Context, typeref, [typedef], (requiredServices) => node.PushServiceProvider(Context, requiredServices), false, true)); Context.IL.Emit(OpCodes.Stloc, vardef); @@ -324,7 +313,7 @@ IEnumerable PushCtorArguments(MethodReference ctorinfo, ElementNode { foreach (var instruction in vnode.PushConvertedValue(Context, parameter.ParameterType, - new ICustomAttributeProvider[] { parameter, parameter.ParameterType.ResolveCached(Context.Cache) }, + [parameter, parameter.ParameterType.ResolveCached(Context.Cache)], (requiredServices) => enode.PushServiceProvider(Context, requiredServices), false, true)) yield return instruction; @@ -362,7 +351,7 @@ IEnumerable PushCtorXArguments(MethodReference factoryCtorInfo, Ele { foreach (var instruction in vnode.PushConvertedValue(Context, parameter.ParameterType, - new ICustomAttributeProvider[] { parameter, parameter.ParameterType.ResolveCached(Context.Cache) }, + [parameter, parameter.ParameterType.ResolveCached(Context.Cache)], (requiredServices) => enode.PushServiceProvider(Context, requiredServices), false, true)) yield return instruction; diff --git a/src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs b/src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs index d4f994bb2397..ee44a126571b 100644 --- a/src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs +++ b/src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs @@ -41,10 +41,7 @@ protected override void DisconnectHandler(UIView platformView) { ItemsView.ScrollToRequested -= ScrollToRequested; _layout = null; - MauiContext?.GetDispatcher()?.Dispatch(() => - { - Controller?.DisposeItemsSource(); - }); + Controller?.DisposeItemsSource(); base.DisconnectHandler(platformView); } diff --git a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt index a8ee9da554ec..c267597f7c7a 100644 --- a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -49,7 +49,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string! -const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string! +const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string! const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string! const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string! diff --git a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt index 4608b2ad1ff2..18f78ab6025e 100644 --- a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -183,7 +183,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string! -const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string! +const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string! const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string! const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string! diff --git a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index 4608b2ad1ff2..18f78ab6025e 100644 --- a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -183,7 +183,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string! -const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string! +const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string! const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string! const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string! diff --git a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index 0a53e93e7fbc..b0deac289648 100644 --- a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -49,7 +49,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string! -const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string! +const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string! const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string! const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string! diff --git a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt index d9e2224b59d9..8be85a498fa7 100644 --- a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -49,7 +49,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string! -const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string! +const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string! const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string! const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string! diff --git a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt index 0a53e93e7fbc..b0deac289648 100644 --- a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt @@ -49,7 +49,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string! -const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string! +const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string! const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string! const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string! diff --git a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt index 0a53e93e7fbc..b0deac289648 100644 --- a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -49,7 +49,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string! -const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string! +const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string! const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string! const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string! const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string! diff --git a/src/Controls/src/Core/TitleBar/TitleBar.cs b/src/Controls/src/Core/TitleBar/TitleBar.cs index e0c7ebbc124f..1f24020b6943 100644 --- a/src/Controls/src/Core/TitleBar/TitleBar.cs +++ b/src/Controls/src/Core/TitleBar/TitleBar.cs @@ -26,7 +26,7 @@ public partial class TitleBar : TemplatedView, ITitleBar, ISafeAreaView public const string TitleBarSubtitle = "PART_Subtitle"; public const string SubtitleVisibleState = "SubtitleVisible"; - public const string SubtitleHiddenState = "SubTitleCollapsed"; + public const string SubtitleHiddenState = "SubtitleCollapsed"; public const string TitleBarLeading = "PART_LeadingContent"; public const string LeadingVisibleState = "LeadingContentVisible"; diff --git a/src/Controls/tests/TestCases.Shared.Tests/UITest.cs b/src/Controls/tests/TestCases.Shared.Tests/UITest.cs index 7b45f566410b..d8767d616747 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/UITest.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/UITest.cs @@ -230,7 +230,18 @@ public override void TestSetup() var device = App.GetTestDevice(); if(device == TestDevice.Android || device == TestDevice.iOS) { - App.SetOrientationPortrait(); + try + { + App.SetOrientationPortrait(); + } + catch + { + // The app might not be ready + // Probably reduce this value if this works + Thread.Sleep(1000); + App.SetOrientationPortrait(); + } + } } } diff --git a/src/Controls/tests/Xaml.UnitTests/BindingsCompiler.xaml.cs b/src/Controls/tests/Xaml.UnitTests/BindingsCompiler.xaml.cs index aa966b64ec28..41e87912d90c 100644 --- a/src/Controls/tests/Xaml.UnitTests/BindingsCompiler.xaml.cs +++ b/src/Controls/tests/Xaml.UnitTests/BindingsCompiler.xaml.cs @@ -29,9 +29,10 @@ public class Tests { [SetUp] public void Setup() => DispatcherProvider.SetCurrent(new DispatcherProviderStub()); [TearDown] public void TearDown() => DispatcherProvider.SetCurrent(null); - - [Test] - public void TestCompiledBindings([Values(false, true)]bool useCompiledXaml) + + [TestCase(false)] + [TestCase(true)] + public void Test(bool useCompiledXaml) { if (useCompiledXaml) MockCompiler.Compile(typeof(BindingsCompiler)); @@ -131,13 +132,6 @@ public void TestCompiledBindings([Values(false, true)]bool useCompiledXaml) //testing binding with path that cannot be statically compiled (we don't support casts in the Path) Assert.That(layout.label13.Text, Is.EqualTo("Global Text")); } - - [Test] - public void BindingsNotAppliedWithWrongContext([Values(false, true)]bool useCompiledXaml) - { - var page = new BindingsCompiler(useCompiledXaml) { BindingContext = new {Text="Foo"} }; - Assert.AreEqual(null, page.label0.Text); - } } } diff --git a/src/Controls/tests/Xaml.UnitTests/Issues/Maui25309.xaml b/src/Controls/tests/Xaml.UnitTests/Issues/Maui25309.xaml new file mode 100644 index 000000000000..85476ceb728b --- /dev/null +++ b/src/Controls/tests/Xaml.UnitTests/Issues/Maui25309.xaml @@ -0,0 +1,22 @@ + + + + + #B1B3B3 + #140F4B + + + + + \ No newline at end of file diff --git a/src/Controls/tests/Xaml.UnitTests/Issues/Maui25309.xaml.cs b/src/Controls/tests/Xaml.UnitTests/Issues/Maui25309.xaml.cs new file mode 100644 index 000000000000..a8ff23cd0292 --- /dev/null +++ b/src/Controls/tests/Xaml.UnitTests/Issues/Maui25309.xaml.cs @@ -0,0 +1,76 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using Microsoft.Maui.ApplicationModel; +using Microsoft.Maui.Controls.Core.UnitTests; +using Microsoft.Maui.Dispatching; +using Microsoft.Maui.Graphics; +using Microsoft.Maui.UnitTests; +using NUnit.Framework; + +namespace Microsoft.Maui.Controls.Xaml.UnitTests; +public partial class Maui25309 : ContentPage +{ + public Maui25309() + { + InitializeComponent(); + } + + public Maui25309(bool useCompiledXaml) + { + //this stub will be replaced at compile time + } + + [TestFixture] + class Test + { + [SetUp] + public void Setup() + { + Application.SetCurrentApplication(new MockApplication()); + DispatcherProvider.SetCurrent(new DispatcherProviderStub()); + } + + [TearDown] public void TearDown() + { + AppInfo.SetCurrent(null); + } + + [Test] + public void GenericConvertersDoesNotThrowNRE([Values(true, false)] bool useCompiledXaml) + { + if (useCompiledXaml) + Assert.DoesNotThrow(()=>MockCompiler.Compile(typeof(Maui25309))); + + var page = new Maui25309(useCompiledXaml) {BindingContext = new { IsValid = true }}; + var converter = page.Resources["IsValidConverter"] as Maui25309BoolToObjectConverter; + Assert.IsNotNull(converter); + Assert.That(page.label.BackgroundColor, Is.EqualTo(Color.Parse("#140F4B"))); + } + } +} + +#nullable enable +class Maui25309BoolToObjectConverter : Maui25309BoolToObjectConverter +{ +} + +public class Maui25309BoolToObjectConverter : IValueConverter +{ + public TObject? TrueObject { get; set; } + + public TObject? FalseObject { get; set; } + + public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { + bool boolValue = false; + if (value is bool bv) + boolValue = bv; + + return boolValue ? TrueObject : FalseObject; + } + + public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/src/Graphics/samples/GraphicsTester.Skia.Windows/GraphicsTester.Skia.Windows.csproj b/src/Graphics/samples/GraphicsTester.Skia.Windows/GraphicsTester.Skia.Windows.csproj index 06a3f1252762..a7beecb8ae8b 100644 --- a/src/Graphics/samples/GraphicsTester.Skia.Windows/GraphicsTester.Skia.Windows.csproj +++ b/src/Graphics/samples/GraphicsTester.Skia.Windows/GraphicsTester.Skia.Windows.csproj @@ -10,7 +10,7 @@ true false - + diff --git a/src/Graphics/src/Graphics/Graphics.csproj b/src/Graphics/src/Graphics/Graphics.csproj index f0f96248502c..0debd85b06fa 100644 --- a/src/Graphics/src/Graphics/Graphics.csproj +++ b/src/Graphics/src/Graphics/Graphics.csproj @@ -39,6 +39,10 @@ + + 10.0.19041.45 + + diff --git a/src/Templates/src/templates/maui-mobile/MainPage.xaml b/src/Templates/src/templates/maui-mobile/MainPage.xaml index 81c95ce3deda..8557b7a0d601 100644 --- a/src/Templates/src/templates/maui-mobile/MainPage.xaml +++ b/src/Templates/src/templates/maui-mobile/MainPage.xaml @@ -11,7 +11,7 @@ Source="dotnet_bot.png" HeightRequest="185" Aspect="AspectFit" - SemanticProperties.Description="dot net bot in a race car number eight" /> + SemanticProperties.Description="dot net bot in a hovercraft number nine" />