In c# uwp, How can be set Maximize on first launch or install not full screen because i set titlebar.

Deepak Patel 60 Reputation points
2025-02-21T06:43:48.8033333+00:00

i want to set maximize app on first install or launch. i set titlebar so that should be visible. i am serching for maximize not for full screen.

  CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
  // Hide default title bar.
  coreTitleBar.ExtendViewIntoTitleBar = true;
  coreTitleBar.IsVisibleChanged += CoreTitleBar_IsVisibleChanged;
  coreTitleBar.LayoutMetricsChanged += CoreTitleBar_LayoutMetricsChanged;
  Window.Current.SetTitleBar(AppTitleBar);
  // Set caption buttons background to transparent.
  ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
  titleBar.ButtonBackgroundColor = Colors.Transparent;
  titleBar.ForegroundColor = Colors.White;
  titleBar.BackgroundColor = Color.FromArgb(255, 27, 30, 36);
  titleBar.ButtonForegroundColor = Colors.White;
  titleBar.ButtonBackgroundColor = Color.FromArgb(255, 27, 30, 36);
  titleBar.ButtonHoverForegroundColor = Colors.White;
  titleBar.ButtonHoverBackgroundColor = Colors.Gray;
  titleBar.ButtonPressedForegroundColor = Colors.White;
  titleBar.ButtonPressedBackgroundColor = Color.FromArgb(255, 27, 30, 36);

  //inactive titlebar color
  titleBar.InactiveForegroundColor = Colors.Gray;
  titleBar.InactiveBackgroundColor = Color.FromArgb(255, 27, 30, 36);
  titleBar.ButtonInactiveForegroundColor = Colors.Gray;
  titleBar.ButtonInactiveBackgroundColor = Color.FromArgb(255, 27, 30, 36);
  // Set XAML element as a drag region.
  //  Window.Current.SetTitleBar(AppTitleBar);
  // Register a handler for when the size of the overlaid caption control changes.


  // Register a handler for when the title bar visibility changes.
  // For example, when the title bar is invoked in full screen mode.

  // Register a handler for when the window activation changes.
  Window.Current.CoreWindow.Activated += CoreWindow_Activated;

XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
831 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.