locked
Need a sticky app bar which stays on right clicking on an item in GriView

    Question

  • Hi,

    I need a sticky app  bar whenever i change view to my semantic zoomed out grid. 

    But when i go to semantic zoomed out view and right click any item in GridView, the app bar disappears. The reason seemed to be that the GridView is not in focus, so i set the Focus property to FocusState::POinter.  But still I am facing the same issue.

    Am I missing something here?

    Thanks in advance for your help.

    -Parul


    Parul Gupta

    Thursday, August 01, 2013 8:31 PM

Answers

  • Hi, gupta.parul08

    I have tried to set focus on GridView, and i search it on google and bing. Then i find a fact that the GridView can't be setted as a focus control. It is just a container. GridView has a event named GetFocus, but when i get its explanation, i find it is occured only when the UIElement within it gets focus. GridView also has a method Focus, but it is just inherited from object, and it's invalid.

    Best Regard!

    Thursday, August 08, 2013 2:37 AM
    Moderator

All replies

  • Hello,

    This workaround isn't elegant but it might work for you. Add an event handler for the app bar's "closed" event. If you want the app bar to stay open you can then set the "IsOpen" property to "true" in the event handler.

    void StickyAppBar::MainPage::m_appBar_Closed(Platform::Object^ sender, Platform::Object^ e)
    {
    	if(m_bABStick)
    		m_appBar->IsOpen = true;
    }
    

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, August 01, 2013 11:42 PM
    Moderator
  • But the problem is that the gridview item is also not getting selected because of this, which is incorrect. If I am right clicking on a GridView item, I want the right click to be received as an event on GridView item and not on bottom app bar.

    Parul Gupta


    • Edited by Ninja8 Friday, August 02, 2013 10:23 AM
    Friday, August 02, 2013 3:18 AM
  • The problem is that my GridView is not in focus. How can i get the focus to GridView? Tried setting the FocusState to all possible states, nothing worked out.

    Parul Gupta

    Friday, August 02, 2013 11:59 AM
  • Hi, gupta.parul08

    I have tried to set focus on GridView, and i search it on google and bing. Then i find a fact that the GridView can't be setted as a focus control. It is just a container. GridView has a event named GetFocus, but when i get its explanation, i find it is occured only when the UIElement within it gets focus. GridView also has a method Focus, but it is just inherited from object, and it's invalid.

    Best Regard!

    Thursday, August 08, 2013 2:37 AM
    Moderator