GithubHelp home page GithubHelp logo

chisterwu / avalonia-customtitlebartemplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from frankenapps/avalonia-customtitlebartemplate

1.0 0.0 0.0 338 KB

Shows how to create custom TitleBars.

License: MIT License

C# 100.00%

avalonia-customtitlebartemplate's Introduction

Avalonia Custom TitleBar Template

This is based on the Aavalonia MVVM Template, but allows for easy customization of the TitleBar, as well as Content on the whole window (e.g. also inside the non-client area). It allows for building TitleBars such as the ones used in Visual Studio Code or in Visual Studio.

Supported Platforms

  • Windows (Fluent Light / Dark) [Default Theme is in the works]
  • MacOS (Fluent Light / Dark) [Not recommended to use, unless you customize the style to match your application.]
  • Linux [For Linux the default behaviour will be to use the native title bar, because there are too many desktop environments and configuration options.]

How to run

  • Clone Repo git clone https://github.com/FrankenApps/Avalonia-CustomTitleBarTemplate.git
  • Change directory cd Avalonia-CustomTitleBarTemplate
  • Run project dotnet run

Intended use

It is likely, that the default implementation does not fit your needs, therefore the main purpose of this project is to give an easy to follow example of how things can be implemented, so that you can implement your own custom title bar.

Use cases

You may find this helpful, if

  • you want content (for example a menu) in the title bar
  • you want to change the background color of the title bar (for DarkMode, etc.)

Avalonia provides its own managed title bar, but I found it hard to customize and did not like the default implementation a lot. However it is easier to set up, so be sure to check it out first by using these attributes for your window:

ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaChromeHints="PreferSystemChrome"
ExtendClientAreaTitleBarHeightHint="-1"

Screenshots

Windows

Windows Screenshot

MacOS

MacOS Screenshot

avalonia-customtitlebartemplate's People

Contributors

frankenapps avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.