Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [UWP] Xamarin 5.0.0.2196 Button in TitleView Visibility Abnormal when changing IsVisible #14776

Closed
SunshineSpring666 opened this issue Oct 21, 2021 · 4 comments
Labels
a/titleview p/UWP s/unverified New report that has yet to be verified t/bug 🐛
Projects

Comments

@SunshineSpring666
Copy link

Description

Steps to Reproduce

  1. Create a Xamarin Project with FlyoutPage.
  2. In the Flyout Detail, place a NavigationPage.
  3. Put a ContentPage in it. In the TitleView of the ContentPage, put two buttons.
  4. Bind a InEdit property to these two buttons to specify editing/viewing page mode.
  5. In the click events, make one button disappear while another button appears.
  6. Run with Xamarin 5.0.0.2196.

Expected Behavior

When pressing the Edit button, it disappears. Cancel button shows up.
When pressing Cancel button, it disappear. Edit button appear again.

Actual Behavior

When pressing the Edit button, everything in TitleView disappears and never show up again.

Basic Information

  • Version with issue: Xamarin 5.0.0.2196
  • Last known good version: Xamarin 5.0.0.2125
  • Platform Target Frameworks:
    • UWP: SDK 22000
  • NuGet Packages: Xamarin.Forms 5.0.0.2196
  • Affected Devices: UWP PC

Environment

Show/Hide Visual Studio info
Microsoft Visual Studio Community 2022 Preview
Version 17.0.0 Preview 6.0
VisualStudio.17.Preview/17.0.0-pre.6.0+31815.197
Microsoft .NET Framework
Version 4.8.04161

Installed Version: Community

Visual C++ 2022   00482-90000-00000-AA366
Microsoft Visual C++ 2022

.NET Core Debugging with WSL   1.0
.NET Core Debugging with WSL

ASP.NET and Web Tools 2019   17.0.776.61824
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019   17.0.776.61824
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   17.0.776.61824
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   17.0.776.61824
Azure Functions and Web Jobs Tools

C# Tools   4.0.0-6.21514.4+df45061e218c9b5813c5531bc06fb238a23e30f6
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus   1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   2.1.134+45632ee938.RR
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.2
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   17.0.11 (54f19d2)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   6.0.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Razor (ASP.NET Core)   17.0.0.2150514+d9e17e7b7f06829e976f616716a987599c5c66e9
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools   17.0.62109.30190
Microsoft SQL Server Data Tools

Syncfusion Xamarin Project Templates   13.4.0.53
A multi-project template for building iOS, Android, and Windows apps using Syncfusion Xamarin components.

Syncfusion Xamarin Toolbox   16.2.0.19
Syncfusion Essential Studio for Xamarin Toolbox Visual Studio extension.

SyncfusionMenu Extension   1.0
SyncfusionMenu Visual Studio Extension Detailed Info

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools   17.0.1001.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.0.0-6.21514.4+df45061e218c9b5813c5531bc06fb238a23e30f6
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   17.0.0-beta.21472.3+f0b5108c92b92ba5ee440228aadba3bae79b43a3
Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions   1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Foo   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   17.0.0.324 (d17-0@b917ee4)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   17.0.0.175 (remotes/origin/main@2e64cffa4)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   17.0.13 (1bcd73e)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   12.1.0.4 (d17-0/642abcd)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: c633fe9
    Java.Interop: xamarin/java.interop/d17-0@8f7ddcdd
    ProGuard: Guardsquare/proguard/v7.0.1@912d149
    SQLite: xamarin/sqlite/3.36.0@a575761
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-0@a5194e9


Xamarin.iOS and Xamarin.Mac SDK   15.0.0.17 (344dcfc35)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Screenshots

Before clicking Edit button, edit button is visible, cancel button is invisible:
BeforeClickingEdit

After clicking Edit button, cancel button should appear. However, everything in TitleView disappears.
(If we put these two buttons in page content, everything is normal. The visibility bug exists in TitleView and in Custom Control if the control has a ScrollView in it):
AfterClickingEdit

Workaround

Downgrade to Xamarin 5.0.0.2125, the visibility bug disappears.

@SunshineSpring666 SunshineSpring666 added s/unverified New report that has yet to be verified t/bug 🐛 labels Oct 21, 2021
@jsuarezruiz jsuarezruiz added this to New in Triage via automation Oct 21, 2021
@jfversluis
Copy link
Member

jfversluis commented Oct 21, 2021

Hey, thanks for the report! Could you try the NuGet package on #14768 as described here and let us know if this fixes this issue?

Besides verifying if this particular issue is fixed also be sure to check other scenarios in the same area to make sure that this fix doesn't accidentally has side-effects 🙂

Thanks!

@SunshineSpring666
Copy link
Author

Sorry, I didn't manage to get it done. So here I made a simply demo project to show the bug:
BlankApp.zip

Thanks a lot.
Best Regards

@solomonfried
Copy link

solomonfried commented Oct 24, 2021

I have created a really simple, single page app, example to illustrate this issue.
The project contains a MainPage.xaml which contains a ScrollView. The ScrollView contains a Grid with a check box that causes the visibility of 2 buttons to toggle.
With the latest Xamarin version, when the Toggle is requested, the second button does not display.
Also of Note If I provide a value to the Grid Row Height where the buttons are placed (instead of "*") then the buttons toggle correctly!!!

The buttons toggle properly using Xamarin.Forms 5.0.0.2125
Also works if the <ScrollView> is removed.

I have attached the project, but the entire code is in MainPage.xaml,

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:testButtonVisibility="clr-namespace:TestButtonVisibility;assembly=TestButtonVisibility"
             xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
             x:Class="TestButtonVisibility.MainPage">
    <ContentPage.Resources>
        <xct:InvertedBoolConverter  x:Key="InverseBoolConverter" />
    </ContentPage.Resources>
    <ScrollView >
        <Grid  x:Name="MainGrid" RowDefinitions="*,*,*" ColumnDefinitions="*,*,*"  >
            <StackLayout Orientation="Vertical" Grid.Row="0" Grid.Column="1" VerticalOptions="Center" >
                <StackLayout Orientation="Horizontal" VerticalOptions="Center" >
                    <Label Text="Swap Buttons"/>
                    <CheckBox x:Name="ButtonToggler" IsChecked="false" />
                </StackLayout>
            </StackLayout>
            <Grid  Grid.Row="1" Grid.Column="1" >
                <Button Text="Button 1" 
                        IsVisible="{Binding Source={x:Reference ButtonToggler}, Path=IsChecked}" Background="Green" />
                <Button Text="Button 2" Background="Blue"
                        IsVisible="{Binding Source={x:Reference ButtonToggler}, Path=IsChecked, Converter={StaticResource InverseBoolConverter}}" />
            </Grid>
        </Grid>
    </ScrollView>
</ContentPage>

TestButtonVisibility.zip

@jfversluis
Copy link
Member

@SunshineSpring666 I can confirm that this is fixed by #14768

@solomonfried your issue is not with the TitleView but is fixed in the current nightly, probably by #14768

Closing this one for now!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/titleview p/UWP s/unverified New report that has yet to be verified t/bug 🐛
Projects
Triage
  
Closed
Development

No branches or pull requests

4 participants