【发布时间】:2016-11-30 21:51:42
【问题描述】:
如果满足特定条件,有没有办法阻止 UWP Splitview 关闭?我实现了以下 PropertyChange 回调:
MySplitView.RegisterPropertyChangedCallback(SplitView.IsPaneOpenProperty, MySplitViewPaneOpenPropertyChanged);
看起来像这样:
private void MySplitViewPaneOpenPropertyChanged(DependencyObject sender, DependencyProperty dp)
{
if (preventClose == true)
{
TrashSplitView.IsPaneOpen = true;
}
}
此代码使拆分视图窗格保持打开状态,但会短暂启动动画。有没有办法阻止动画开始?
【问题讨论】:
-
我看到的唯一方法是使用 DisplayMode="Inline" 而不是“Overlay”。但是如果你需要内联模式,这是没用的。
-
我真的想通了!检查我发布的答案。感谢您的评论