locked
Is there a way to get the CharmsBar Width? RRS feed

  • Question

  • I would like to resize some controls of my App when the CharmsBar (specially the SearchPane) opens. I have made some tests and the width is usually 343 but sometimes it is greater (it depends on the size of the screen, not on the resolution. At least, using the emulator). 

    Does somebody know if there is a programatic method to get that value?

    Saturday, December 22, 2012 3:07 PM

Answers

  • but with bigger resolutation  zoom factor is applied see: http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx

    so probally you have 140% zoomfactor whihchmeans 346 * 1,4 = 484

    the info you need for this you can access with this class:

    Windows.Graphics.Display.DisplayProperties
    

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#


    • Edited by Dave SmitsMVP Monday, December 24, 2012 3:26 PM
    • Proposed as answer by Jesse Jiang Tuesday, December 25, 2012 8:11 AM
    • Marked as answer by Daniel San Tuesday, December 25, 2012 1:04 PM
    Monday, December 24, 2012 3:23 PM

All replies

  • Hi,

    I just found a document, I think it should be the fixed value.

    Flyouts must be full screen height, regardless of orientation, and should be narrow (346 pixels) or wide (646 pixels). Choose the size that's appropriate for the content and don't create custom sizes.

    From http://msdn.microsoft.com/en-us/library/windows/apps/hh770544.aspx

    Best regards,
    Jesse


    Jesse Jiang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Jesse Jiang Tuesday, December 25, 2012 8:11 AM
    Monday, December 24, 2012 11:23 AM
  • Run the emulator, set resolution to 10.6" 1920x1080, press Win+Q, take a screenshoot.

    Now set the resolution to 23" 1920x1080 and do the same.

    Compare both images; The width of the search pane is different (343 pixels vs 481 pixels).

    The guidelines that you suggested are ok, but I'm more interesed in real behavior of the native charm bars.

    Regards

    Monday, December 24, 2012 11:40 AM
  • but with bigger resolutation  zoom factor is applied see: http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx

    so probally you have 140% zoomfactor whihchmeans 346 * 1,4 = 484

    the info you need for this you can access with this class:

    Windows.Graphics.Display.DisplayProperties
    

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#


    • Edited by Dave SmitsMVP Monday, December 24, 2012 3:26 PM
    • Proposed as answer by Jesse Jiang Tuesday, December 25, 2012 8:11 AM
    • Marked as answer by Daniel San Tuesday, December 25, 2012 1:04 PM
    Monday, December 24, 2012 3:23 PM
  • I did't know about this property. That help me a lot. Thanks dude!
    Tuesday, December 25, 2012 1:05 PM