【问题标题】:MultiSelectList Exception when disabling the RootFrame禁用 RootFrame 时的 MultiSelectList 异常
【发布时间】:2014-03-20 22:17:04
【问题描述】:

我有一个使用 MultiSelectList 的 Windows Phone 8 应用程序。一般的工作流程应该是用户选择列表中的一个或多个项目,然后单击打开弹出对话框的应用栏按钮。由于对话框比屏幕小,因此在打开对话框时应禁用该列表。

框架的禁用部分似乎有问题。

应用程序的 RootFrame 是一个 TransitionFrame。

就在弹出窗口打开之前,代码调用

_frame.IsEnabled = false; (where _frame = RootFrame)

似乎此调用以某种方式生成了以下形式的异常:

Application_UnhandledException() System.Exception: Error HRESULT E_FAIL has been returned from a call to a COM component.
at MS.Internal.XcpImports.VisualStateManager_GoToState(Control reference, String StateName, Boolean useTransitions, Boolean& refreshInheritanceContext)
at System.Windows.VisualStateManager.GoToState(Control control, String stateName, Boolean useTransitions)
at System.Windows.Controls.Primitives.ToggleButton.ChangeVisualState(Boolean useTransitions)
at System.Windows.Controls.Primitives.ButtonBase.OnIsEnabledChanged(IsEnabledChangedEventArgs e)
at System.Windows.Controls.Control.OnIsEnabledChanged(Control control, EventArgs args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

当我拿出 _frame.IsEnabled = false 调用时,没有例外(也没有任何东西被禁用)

我怀疑异常中的 ToggleButton 是指 MutliSelectList 的复选框。

我完全卡住了,不知道如何调试了。

【问题讨论】:

    标签: c# xaml windows-phone-8 multi-select


    【解决方案1】:

    为什么禁用RootFrame,可以直接禁用MultiselectList。当您禁用 RootFrame 时,页面上的所有控件都将不可用,除了 ApplicationBar。所以列表上的对话框弹出也是禁用的。所以我认为这不是一个好方法。希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-26
      • 2015-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-23
      • 1970-01-01
      相关资源
      最近更新 更多