显示StatusBar时,ContentDialog消失

时间:2016-01-27 10:22:16

标签: dialog windows-phone-8.1

在显示ContentDialog时,我有一种奇怪的行为。当对话框出现在屏幕上并向下拖动状态栏时,对话框将消失。

private ContentDialog _connectivityDialog = new ContentDialog { IsPrimaryButtonEnabled = false, IsSecondaryButtonEnabled = false, Title = "Test"};

某处我只是致电_connectivityDialog.ShowAsync();

我制作了一个简单的项目来重现这种行为: https://www.dropbox.com/sh/0a6ad5xtrzii7sx/AADnbF9TGpfJnV9xnVG4FQMJa?dl=0

知道为什么会这样吗?

1 个答案:

答案 0 :(得分:1)

我在调查另一个问题时找到了解决方案:

BackButton驳回了对话框。

解决方案:

Hide()

但请注意,public boolean waitForPageToLoad(String timeOutInSeconds) throws ScreenShotException, InterruptedException { boolean bFlag = false; WebElement element; boolean bStatus = true; int timeinseconds1 = Integer.parseInt(timeOutInSeconds); try { WebDriverWait wait = new WebDriverWait(webDriver, timeinseconds1); while(timeinseconds1 > 0) { element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("myDynamicElement"))); Log.info("Element status at runtime -->"+element.isDisplayed()); if(!element.isDisplayed()) { timeinseconds1 = timeinseconds1 - 500; Thread.sleep(1000); } else { System.out.println("working"); bFlag = bStatus; Log.info("Element status: - >"+bFlag); break; } } } catch (Exception e) { screenShot.screenShot(e); } return bFlag; } - 方法也会受到影响。你可以在这篇文章中做一个解决方法: How to prevent the ContentDialog from closing when home key is pressed in Windows phone 8.1..?