Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to disable Windows 8/WinRT AppBar?
    primarykey
    data
    text
    <p>My goal is to only have an AppBar available under a certain circumstance. I am attempting to accomplish this by creating an AppBar, but leaving it disabled until that circumstance arises. However, if you set the <code>IsEnabled</code> attribute on an AppBar to <code>False</code>, when you launch your app and right-click (which typically opens the AppBar), the application crashes. Is this a bug in the framework? What is the proper way to disable an AppBar?</p> <p>EDIT: It also occurs when you set <code>Visibility</code> to <code>Collapsed</code>.</p> <p>More info: I am running it through the Visual Studio debugger, but a separate "Visual Studio Just-In-Time Debugger" window is popping up with the message "An unhandled win32 exception occurred in App.exe [2596]." A warning box pops up on top of that that says "A debugger is attached to App.exe but not configured to debug this unhandled exception. To debug this exception, detach the current debugger."</p> <p>EDIT 2: It's not just my code. It also crashes if you just add <code>IsEnabled="False"</code> to the AppBar in Microsoft's own sample AppBarControl project (found here: <a href="http://code.msdn.microsoft.com/windowsapps/XAML-AppBar-control-sample-2aa1cbb4">http://code.msdn.microsoft.com/windowsapps/XAML-AppBar-control-sample-2aa1cbb4</a>)</p> <p>EDIT 3: @G. Andrew Duthie - devhammer provided the answer I am using. I just wanted to add that I found that it is best to use <code>this.BottomAppBar = null</code> to disable it as opposed to setting the <code>IsEnabled</code> or <code>Visibility</code> properties. If you just set <code>Visibility</code> to <code>Collapsed</code>, then when you right-click, the app still thinks an AppBar is present even though it isn't visible, so your next regular click will be interpreted as the click that typically dismisses the AppBar, so you'll have to click a second time to actually carry out the action you were attempting.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload