Ahmed Ali
Ahmed Ali

Reputation: 2668

Disable Appbars in snapview in Windows 8 Application

is there any way to disable Appbar in snapview state ?! i'm using HTML5 and javascript to build my application

Upvotes: 2

Views: 1321

Answers (7)

Gouthamm4G
Gouthamm4G

Reputation: 31

You can do it programmatically on resize event like this:

window.addEventListener("resize", snapAppBar, false);

function snapAppBar() {
    var height = <height>;
    var condition = (document.querySelector("body").clientWidth < height);
    if (condition) {
        document.querySelector("#appbar").winControl.disabled = <"true"|| "false">;
    }
}

If you still need help that is!

Upvotes: 0

user1612250
user1612250

Reputation: 151

Add an ID 'appbar' to it and css

@media screen and (-ms-view-state: snapped) {
    #appbar {
    display:none;
    }
}

Upvotes: 0

user1714962
user1714962

Reputation: 33

you can disable the app bar in Snap View. You need to change the visibility in Snap view as "Collapsed" and in other views as "Visible"

Upvotes: 0

Mahmoud
Mahmoud

Reputation: 1181

I think you can't do that in a windows 8 application

Upvotes: 1

Disco Banana
Disco Banana

Reputation: 102

You can use CSS/JS to disable the Appbar in Snap View; however, if this app is meant for the store then when it comes to certification for the store that can cause an issue as you are supposed to support the appbar in all views.

You can disable/hide particular items in the snapview with CSS (disabled or hidden CSS properties) so that the appbar only has items in it that are meaningful in the snapped view.

Guidelines and checklists for Appbars - http://msdn.microsoft.com/en-us/library/windows/apps/hh465302.aspx

Upvotes: 2

Dominic Hopton
Dominic Hopton

Reputation: 7292

There is no explicit way to disable the app bar. Two things to try:

  • display: none on the app bar element it's self
  • or remove the appear element from the dom

Upvotes: 0

Snapped view and other view states are an integral part of the Windows 8 user experience and cannot be disabled. Apps need to be prepared to handle snapped, filled, fullscreen-landscape, and fullscreen-portrait.

As for the app bar, just don't declare one in the app. For example, create a new project using the Blank project template in Visual Studio or Blend and you'll see that it has no appbar behavior.

If you're asking whether you can disable the charms bar (swiped in from the right edge), then no, you cannot disable that. Again, it's an integral part of the system.

Upvotes: 0

Related Questions