使用WPF时,为什么无法访问情节提要。在Silverlight中,完全相同的代码也可以工作。
VB背后的代码
Public Class UserControl1
Private Sub UserControl1_MouseLeftButtonDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles Me.MouseLeftButtonDown
Me.storyboardBlend.Begin()
End Sub
End Class
XAM
我发现了一些与WPF相关的示例,但没有一个是针对Silverlight的。
那么,在代码中设置的工作示例是什么?
这是我目前拥有的代码,尽管它不工作(没有异常,但在运行时没有发生任何事情):
// Set up a storyboard
var duration = new Duration(TimeSpan.FromMilliseconds(400));
var animation = new ColorAnimation
{
To = Colors.White,
RepeatBehavior = RepeatBehavior.Forever,
AutoReverse
在WPF中,我经常使用这样的结构:
SomeChildWindow dlg = new SomeChildWindow();
dlg.ShowDialog();
...
//child window is closed either by "this.DialogResult = true;" or just by "Close();"
//and in Parent window after Child window is closed we can use condition based on that
...
if (dlg.DialogR