我使用以下代码来注入视图成网格:使用户控件从屏幕的一侧“滑出”?
private void OnShowNotesRequested(UserControl view)
{
if (view == null) throw new NotSupportedException("View should not be null");
// Skip first GridRow - this is usually Toolbar
if (this.AssociatedObject.RowDefinitions.Count > 1)
{
view.SetValue(Grid.RowSpanProperty, this.AssociatedObject.RowDefinitions.Count - 1);
view.SetValue(Grid.RowProperty, 1);
}
view.SetValue(Grid.ColumnSpanProperty, this.AssociatedObject.ColumnDefinitions.Count == 0 ? 1 : this.AssociatedObject.ColumnDefinitions.Count);
view.Width = 500;
view.HorizontalAlignment = HorizontalAlignment.Right;
this.AssociatedObject.Children.Add(view);
}
基本上,我添加视图作为子到电网。它靠码头到右边。
我想让它看起来像这个视图滑出右侧并停下来。我不知道如何接近它,我该怎么做才能达到这种视觉效果。任何指针什么和我需要添加的地方?也许链接到类似的效果?
我发现了一些动画代码在这里:http://forums.silverlight.net/t/82441.aspx
这是有道理的,但是当我躲在我的看法 - 我完全可视树,像这样将其删除:this.AssociatedObject.Children.Remove(view)
不知道如何“等待”,然后将其删除。
我推荐Expression Blend。 – Jordan 2012-03-28 14:31:14