AutoCompleteBox弹出窗口有时会自动打开(当它不应该打开时),有时不会打开? [英] AutoCompleteBox Popup sometimes opens automatically (when it shouldn't) and sometimes doesn't?

查看:68
本文介绍了AutoCompleteBox弹出窗口有时会自动打开(当它不应该打开时),有时不会打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Silverlight框架中的页面上有一堆AutoCompleteBoxes。这些盒子是成对的。 第一个框选择一个类别,第二个框的itemssource 被绑定到所选类别的子类别。

I have a bunch of AutoCompleteBoxes on a page that is in a Silverlight Frame. The boxes are in pairs.  The first box select a Category and the second box's itemssource is bound to SubCategories for that selected Category.

一切正常。

SelectedCategory和SelectedSubCategory绑定到各自框的SelectedItem。

SelectedCategory and SelectedSubCategory are bound to SelectedItem of their respective boxes.

问题是,第一次显示页面时,一切看起来都很好。 但在导航并返回该页面后(在更改框架内容的应用程序内),子类别组合框的弹出窗口正在显示。 我想
只有当有多个选项与所选值匹配时才会发生这种情况。

The problem is, the first time the page is shown, everything looks fine.  But after navigating away and coming back to that page (within the app that is changing the frame contents), the subcategory comboboxes' popup windows are showing.  I THINK this only happens when there is more than one choice that matches the selected value.

我试图在加载viewmodel时关闭所有弹出窗口,但它没有'做出任何改变。 事实上,当viewmodel加载了所有数据并触发了加载完成的事件时,处理程序代码显示弹出窗口当时没有打开
。 

I tried to close all the popups when the viewmodel was loaded, but it didn't make any difference.  In fact, when the viewmodel had loaded all its data and fired the event that it was done loading, the handler code showed that the popup was NOT open at the time. 

如何在显示页面时确保弹出窗口始终关闭? 任何线索都欢迎。

How can I make sure that the popups are always closed when the page is shown?  Any clues welcome.

推荐答案

Silverlight中没有popup.staysopen。

There is no popup.staysopen in Silverlight.

你可以试试这个:

https://shemesh.wordpress.com/2013/03/17/silverlight-close-popup-on-click-outside/

可能是某些代码正在打开它并且你没有意识到它已经运行了吗?

Could it be some piece of code is opening it and you don't realise it's run?

您可以在任何代码上设置断点将打开弹出窗口或isopen的setter属性,如果它是绑定的。

You could perhaps put a break point on any code will open the popup or the setter of the isopen property if it's bound.


这篇关于AutoCompleteBox弹出窗口有时会自动打开(当它不应该打开时),有时不会打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆