This repository has been archived by the owner on May 1, 2024. It is now read-only.
[F100] Add "Target" support to VisualStateManager #4924
Labels
a/VSM
blocker
Issue blocks next stable release. Prioritize fixing and reviewing this issue.
F100
help wanted
We welcome community contributions to any issue, but these might be a good place to start!
in-progress
This issue has an associated pull request that may resolve it!
inactive
Issue is older than 6 months and needs to be retested
roadmap
t/enhancement ➕
up-for-grabs
We welcome community contributions to any issue, but these might be a good place to start!
Milestone
Summary
This probably should be in this issue (#4232), but I thought I would create a new one as this might be a smaller task.
I was porting my UWP app to Xamarin.Forms and I noticed that the VisualStateManager does not allow states to affect child controls. Take this pseudo xaml:
This XAML allows the VSM to modify properties on the children, not just the current element.
https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.setter.target#Windows_UI_Xaml_Setter_Target
https://docs.microsoft.com/en-us/dotnet/api/system.windows.setter.targetname?view=netframework-4.7.2#System_Windows_Setter_TargetName
API Changes
I am not sure if the UWP or the WPF route is better, but we might just be able to add a
TargetName
property toSetter
and then instead of athis.SetProperty(PropertyName, Value)
we wouldthis.FindElement(TargetName).SetProperty(PropertyName, Value)
.Intended Use Case
This will solve the issue of multiple VSM elements in a single page that responds to a single event, such as a state for a wide screen or a narrow screen, or for device orientation. One VSM can control the entire page.
The use case that I was working on was on a narrow screen, I would have 2 columns in my grid, but on a wide screen, I would have 4 and show a big header with more features.
The text was updated successfully, but these errors were encountered: