컨트롤 템플릿 내에서 VisualStates를 정의하는 경우 스토리 보드에서 템플릿 컨트롤 자체의 속성을 변경할 수 있습니까? 다음은 간단한 예입니다.VisualState에서 템플릿 컨트롤의 속성을 변경하는 방법?
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Window.Template>
<ControlTemplate TargetType="{x:Type Window}">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="WindowStyleStates"
x:Uid="WindowStyleStates">
<Storyboard x:Uid="Storyboard_1">
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="?????"
Storyboard.TargetProperty="ResizeMode">
<DiscreteObjectKeyFrame KeyTime="0"
Value="CanResizeWithGrip" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Window.Template>
</Window>
문제는 스토리 보드는 그리드 내에 정의 된 개체에만 액세스 할 수 있다는 것입니다. Window에 대한 controltemplate을 정의하고 있다면 왜 템플릿을 만들고있는 Window에서 값을 변경할 수 없습니까?
시각적 상태를 제어 템플릿 밖으로 이동하면 부분적으로 템플릿 창이 속성이 수정됩니다. Expression Blend는 컨트롤 자체에 배치 된 상태를 확인하지 않기 때문에 선호하는 메서드라고 생각하지 않습니다. –