Skip to content

J-Wachs/Super-Maximize-button-and-functionality-.NET-MAUI-Blazor-Hybrid-Windows-application

Repository files navigation

Click here for English version

Super Maximize button

Danish version:

"Super Maksimér" knap i titlebjælken i en .NET MAUI Blazor Hybrid Windows applikation

Maksimér knappen i titlebjælken, udvider vinduet til at fylde skærmen. "Super Maksimér" tager den et skridt videre og maksimerer vinduet til alle skærme, forudsat at skærmene er konfigureret til at udvide skrivebordet.

Dette repository viser, hvordan du kan tilføje en knap til titelbjælken, og "Super Maksimér" funktionaliteten til din applikation.

Bemærk venligst, at "Super Maksimér" funktionaliteten ikke er specifik for .NET MAUI Blazor Hybrid applikationer. Den kan også bruges i andre typer af Windows GUI applikationer, fx WPF og WinForms.

Eksemplet tager afsæt i applikationen fra mit repo "Change Title and Subtitle in a ,NET MAUI Blazor Hybrid Windows application".

Sådan gør du

  1. Tilføj klassen SuperMaximizeForWindows.cs til din .NET MAUI Blazor Hybrid applikation

  2. Tilføj klassen TitleBarTools.cs til din .NET MAUI Blazor Hybrid applikation

  3. Implementer TitleBarService klassen

  4. Implementer TitleBarTools klassen

  5. Registrer TitleBarService i MauiProgram.cs filen

  6. Tilret App.xaml.cs filen der ligger i roden, så den opretter et TitleBar objekt og kalder metoden BuildTitleBar i SuperMaximizeForWindows klassen. Denne metode tilføjer knappen og implementerer "Super Maksimér" funktionaliteten

  7. I App.xaml.cs skal du også koble ind i event'et "window.Created" for at få de initielle værdier for vinduets position og størrelse

Kik i koden for at se, hvordan det hele hænger sammen.

Implementering i dine egne projekter

Du kan kopiere de relevante filer og kodebidder fra dette repository til dine egne .NET MAUI Blazor Hybrid projekter, eller din værktøjskasse, så har du det klar og skal kun angive et minimum af kode.

Anerkendelse

Venligst læs dokumentet "Acknowledgements.md".


'Super Maximize' button in the title bar of a .NET MAUI Blazor Hybrid Windows application

The Maximize button in the title bar expands the window to fill the screen. 'Super Maximize' takes it a step further and maximizes the window across all screens, provided the screens are configured to extend the desktop.

This repository demonstrates how to add a button to the title bar and implement the 'Super Maximize' functionality in your application.

Please note that the 'Super Maximize' functionality is not specific to .NET MAUI Blazor Hybrid applications. It can also be used in other types of Windows GUI applications, such as WPF and WinForms.

The example is based on the application from my repository 'Change Title and Subtitle in a .NET MAUI Blazor Hybrid Windows application'.

How to do it

  1. Add the class SuperMaximizeForWindows.cs to your .NET MAUI Blazor Hybrid application.

  2. Add the class TitleBarTools.cs to your .NET MAUI Blazor Hybrid application.

  3. Implement the TitleBarService class.

  4. Implement the TitleBarTools class.

  5. Register TitleBarService in the MauiProgram.cs file.

  6. Modify the App.xaml.cs file located in the root so that it creates a TitleBar object and calls the

  7. BuildTitleBar method in the SuperMaximizeForWindows class. This method adds the button and implements

  8. the "Super Maximize" functionality.

  9. In App.xaml.cs, you must also hook into the window.Created event to obtain the initial values for the

  10. window's position and size.

Check the code to see how everything fits together.

Implementation in your own projects

You can copy the relevant files and code snippets from this repository to your own .NET MAUI Blazor Hybrid projects or your personal toolbox. This way, you have it ready and only need to provide a minimum of code.

Acknowledgement

Please read the document 'Acknowledgements.md'.

About

C# classes for adding a custom button in the titlebar and call the Super Maximize functionality

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages