我正在研究mvvm架构。我正在尝试运行从视图模型混合制作的动画。我能够在我的视图模型中制作故事板对象。但我无法使用find方法在视图模型类中查找我的故事板名称。告诉我该怎么做。
this is my viewmodel
class MypageViewModel : INotifyPropertyChanged,IValueConverter
{
private Visibility advancedFormat = Visibility.Collapsed;
public MypageViewModel()
{
// CheckedInCommand = new CheckInButtonClick();
Storyboard sb = new Storyboard();
// unable to find
sb.Begin();
advancedFormat = Visibility.Visible;
}
}
////////// mypage.xaml中的故事板
<Storyboard x:Name="Storyboard1">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="SecondaryGrid">
<EasingDoubleKeyFrame KeyTime="0" Value="-692.752"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</Page.Resources>