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

[Bug] Visual State Manager crashes application when using controltemplate #10710

Open
SFSteve opened this issue May 15, 2020 · 0 comments
Open
Labels
a/VSM e/3 🕒 3 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often t/bug 🐛

Comments

@SFSteve
Copy link

SFSteve commented May 15, 2020

Description

When using Visual State Manager, if the VisualStateGroup is placed on a parent element with a TargetName on a page that uses a control template, the application crashes when Setter.Apply fires.

The issue seems to be caused by the TargetName property of the Setter, in that line 58 of Xamarin.Forms.Core/Setter.cs is throwing a null exception when trying to perform element.FindByName(TargetName)
Commenting out the ControlTemplate in the ContentView results in everything working as expected, as seen in the provided example app.

VSMTestApp.zip

Steps to Reproduce

  1. Create an app with a page that uses a control template
  2. Add a stacklayout with one or more child elements
  3. Apply a visual state group to the stacklayout and make the TargetName of the setter the child element
  4. Fire the GoToState method against the stacklayout

Expected Behavior

The child element property is set

Actual Behavior

The application crashes with a null value exception

Basic Information

  • Version with issue: All
  • Last known good version: None
  • IDE: Visual Studio 2019
  • Platform Target Frameworks:
    • Android: 9.0
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

Workaround

@SFSteve SFSteve added s/unverified New report that has yet to be verified t/bug 🐛 labels May 15, 2020
@PureWeen PureWeen removed the s/unverified New report that has yet to be verified label May 15, 2020
@PureWeen PureWeen added this to the 4.6.0 milestone May 15, 2020
@samhouts samhouts added a/VSM i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often e/3 🕒 3 and removed m/high impact ⬛ labels May 27, 2020
@samhouts samhouts removed this from the 4.6.0 milestone Jul 8, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/VSM e/3 🕒 3 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often t/bug 🐛
Projects
None yet
Development

No branches or pull requests

3 participants