Modern software trends

How to hide titlebar in WPF Project for Xamarin Forms | Fullscreen Xamarin WPF App



If you want to hide Titlebar / Header /Toolbar in Xamarin WPF Window just add the following function to your MainWindow.xaml.cs file (just after MainWindow() constructor is fine)

 
  protected override void OnActivated(EventArgs e)
  {
      base.OnActivated(e);

      var commandsBar = (System.Windows.Controls.Grid)this.Template.FindName("PART_CommandsBar", this);
      commandsBar.MaxHeight = 0;

      System.Windows.Controls.Border border = (System.Windows.Controls.Border)this.Template.FindName("BorderWindow", this);
      border.BorderThickness = new System.Windows.Thickness(0);

      var headline = this.Template.FindName("PART_TopAppBar", this) as Xamarin.Forms.Platform.WPF.Controls.FormsAppBar;
      if (headline != null)
      {
          headline.MaxHeight = 0; 
      }
  }
  

Post a Comment

0 Comments