【发布时间】: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