diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Dynamic.xaml b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Dynamic.xaml index 30b794c2248e..777f7025c37e 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Dynamic.xaml +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Dynamic.xaml @@ -1,162 +1,182 @@ - - + - - - - - - - + + + + + + + - + - - - - - - + + + + + + + + + - - + + - - - + + - - - + + - - + - - - - - - - - + + + + + + + - - + - - - + + - - + - - - - - - - - + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Dynamic.xaml.cs b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Dynamic.xaml.cs index 7c46f1270f89..ba716828dd18 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Dynamic.xaml.cs +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Dynamic.xaml.cs @@ -17,7 +17,7 @@ namespace Uno.UI.Samples.Content.UITests.CommandBar { [SampleControlInfo("CommandBar", "Dynamic", ignoreInSnapshotTests: true)] - public sealed partial class CommandBar_Dynamic : UserControl + public sealed partial class CommandBar_Dynamic : Page { public CommandBar_Dynamic() { diff --git a/src/Uno.UI/Controls/CommandBarRenderer.iOS.cs b/src/Uno.UI/Controls/CommandBarRenderer.iOS.cs index 9adbe833366b..06ebab50a5f6 100644 --- a/src/Uno.UI/Controls/CommandBarRenderer.iOS.cs +++ b/src/Uno.UI/Controls/CommandBarRenderer.iOS.cs @@ -78,21 +78,21 @@ protected override void Render() var backgroundColor = Brush.GetColorWithOpacity(Element.Background); switch (backgroundColor) { - case Color opaqueColor when opaqueColor.A == byte.MaxValue: + case { } opaqueColor when opaqueColor.A == byte.MaxValue: // Prefer BarTintColor because it supports smooth transitions Native.BarTintColor = opaqueColor; Native.Translucent = false; //Make fully opaque for consistency with SetBackgroundImage Native.SetBackgroundImage(null, UIBarMetrics.Default); Native.ShadowImage = null; break; - case Color semiTransparentColor when semiTransparentColor.A > 0: + case { } semiTransparentColor when semiTransparentColor.A > 0: Native.BarTintColor = null; // Use SetBackgroundImage as hack to support semi-transparent background Native.SetBackgroundImage(((UIColor)semiTransparentColor).ToUIImage(), UIBarMetrics.Default); Native.Translucent = true; Native.ShadowImage = null; break; - case Color transparent when transparent.A == 0: + case { } transparent when transparent.A == 0: Native.BarTintColor = null; Native.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); // We make sure a transparent bar doesn't cast a shadow. @@ -117,11 +117,6 @@ protected override void Render() : null; Native.BackIndicatorImage = backButtonIcon; Native.BackIndicatorTransitionMaskImage = backButtonIcon; - - if (Element.Presenter != null) - { - Element.Presenter.Height = Native.Hidden ? 0 : Native.Frame.Size.Height; - } } private void ApplyVisibility()