Skip to content

w-ahmad/WinUIEx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinUIEx

WinUI Extensions

image

A set of extension methods and classes to fill some gaps in WinUI 3, mostly around windowing.

To get the extension methods, first add using WinUIEx; to the top of your code.

  • Minimize/Maximize/Restore and Hide window.
    myWindow.MinimizeWindow();
    myWindow.MaximizeWindow();
    myWindow.RestoreWindow();
    myWindow.HideWindow();`
  • Move and resize window
   myWindow.CenterOnScreen();
   myWindow.SetWindowPositionAndSize(100, 100, 1024, 768);
  • Make Window always-on-top
    myWindow.SetAlwaysOnTop(true);
  • Bring window to the top
    myWindow.BringToFront();
  • Remove Window chrome buttons

Make your window class inherit from WinUIEx.WindowEx instead, and set properties IsCloseButtonVisible, IsMaximizeButtonVisible, IsMinimizeButtonVisible

  • Create a Tray Icon
    var icon = Icon.FromFile("Images/WindowIcon.ico");
    tray = new TrayIcon(icon);
    tray.TrayIconLeftMouseDown += (s, e) => this.BringToFront();

And more to come...

image

About

WinUI Extensions

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C# 87.2%
  • PowerShell 12.8%