Windows Universal App Fullscreen Button

后端 未结 3 783
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-05 15:15

Some Apps in the Windows Store have a Fullscreen button additional to the minimize, maximize and close button in the Titlebar. This button looks similar to the exit Fullscre

3条回答
  •  旧时难觅i
    2020-12-05 15:44

    You'll have to use the Window.SetTitleBar method to achieve your desired behavior. Therefore, you'll need to accomplish a few steps:

    First, enable the view to extend into the title bar. Please note, that you can only set the left part of the title bar. The Minimize, Maximize and Close buttons will still be there:

    CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
    

    After you have set that, you call the Window.SetTitleBar method with an UIElement:

    Window.Current.SetTitleBar(myTitleBar);
    

    Where as myTitleBar could look like this:

    
        
            
                
                
            
    
            
            
    
            
            
                

    An extended guide by Marco Minerva (including a nice XAML behavior that will tweak this use-case even better) can be found here.

提交回复
热议问题