Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reset the value of the property BackgroundGradientStops in VisualStateManager? #173

Open
ArtemProg opened this issue Apr 10, 2022 · 0 comments

Comments

@ArtemProg
Copy link

The code leads to an error:
<Setter Property="BackgroundGradientStops" Value="{x:Null}" />
image

This code works:

<Setter Property="BackgroundGradientStops">
	<Setter.Value>
		<yummy:GradientStopCollection/>
	</Setter.Value>
</Setter>

Full example with error:

<yummy:PancakeView>

	<VisualStateManager.VisualStateGroups>
		<VisualStateGroup x:Name="CommonStates">
			
			<VisualState x:Name="Normal">
				<VisualState.Setters>
					<Setter Property="BackgroundGradientStops" Value="{x:Null}" />
				</VisualState.Setters>
			</VisualState>
			
			<VisualState x:Name="Selected">
				<VisualState.Setters>
					<Setter Property="BackgroundGradientStartPoint" Value="0,0" />
					<Setter Property="BackgroundGradientEndPoint" Value="1,0" />
					<Setter Property="BackgroundGradientStops">
						<Setter.Value>
							<yummy:GradientStopCollection>
								<yummy:GradientStop Color="#ff4157" Offset="0" />
								<yummy:GradientStop Color="#ff4359" Offset="0.5" />
								<yummy:GradientStop Color="#fe93c5" Offset="1" />
							</yummy:GradientStopCollection>
						</Setter.Value>
					</Setter>
				</VisualState.Setters>
			</VisualState>
			
		</VisualStateGroup>
	</VisualStateManager.VisualStateGroups>
	
</yummy:PancakeView>

Tell me why you can not use Value = "{x: null}"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant