![](/img/trans.png)
[英]Make my wpf application Full Screen (Cover taskbar and title bar of window)
[英]How to remove title bar on xamarin wpf and make the application full screen
這就是我刪除Xamarin.Forms創建的所有條的方式(在v3.2中進行了測試):
添加刪除方法:
private bool topBarsRemoved = false; private void RemoveTopBars() { System.Windows.Controls.Grid commandBar = this.Template.FindName("PART_CommandsBar", this) as System.Windows.Controls.Grid; if (commandBar != null) (commandBar.Parent as System.Windows.Controls.Grid)?.Children.Remove(commandBar); var topAppBar = this.Template.FindName("PART_TopAppBar", this) as WpfLightToolkit.Controls.LightAppBar; if (topAppBar != null) (topAppBar.Parent as System.Windows.Controls.Grid)?.Children.Remove(topAppBar); topBarsRemoved = true; }
調用方法:
protected override void OnActivated(EventArgs e) { base.OnActivated(e); if (!topBarsRemoved) RemoveTopBars(); }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.