iNKORE-NET / UI.WPF.Modern

Modern (Fluent 2) styles and controls for your WPF applications
https://docs.inkore.net/ui-wpf-modern
GNU Lesser General Public License v2.1
326 stars 29 forks source link

Way to remove the title bar #48

Closed sumit-codebrewer closed 2 months ago

sumit-codebrewer commented 4 months ago

Thankyou for supporting me in my last issue.

I have been trying to remove the title bar from my window by setting WindowStyle ="None" which ideally works for any wpf window. After integrating inkore modern wpf library, it is giving a default title bar at the top. And if I set its height to 0, my buttons will superimpose the bar and stops working. What is showing

image

What I want

image

Any ideas, how to remove this?

NotYoojun commented 4 months ago

Try the attached property TitleBar.ExtendViewIntoTitleBar.

https://github.com/iNKORE-Public/UI.WPF.Modern/blob/main/source%2FiNKORE.UI.WPF.Modern%2FControls%2FPrimitives%2FTitleBar.cs#L296-L311

sumit-codebrewer commented 4 months ago

Here is the output of that, already tried it earlier

image

The button is overlapping with the title bar and hence, again it will not work.

biocross commented 4 months ago

Is there a way to remove the close / minimise / maximise buttons?

NotYoojun commented 3 months ago

This might be a little difficult. Maybe you can use WindowStyle=None and UseModernWindowStyle=false to disable the default frames.

Or I can add some more attached properties for everyone to control the states of the control button. However, I'm afraid this has to be on a few months later cause I'm really busy these days doing web development.

NotYoojun commented 3 months ago

Hi there, We have add some properties to fully customize your title bar buttons. However, I'm afraid you have to wait a moment before you can use this feature in the nuget package. You can compile your own by cloning the latest source code (I have pushed the commits). Also I have made an example for customizing window styles.

image

Here's a sample you can use in the latest version in the future:

<Window x:Class="WindowExample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
        xmlns:local="clr-namespace:WindowExample" xmlns:sys="clr-namespace:System;assembly=netstandard"
        mc:Ignorable="d"
        ui:WindowHelper.UseModernWindowStyle="True" ui:TitleBar.Height="36"
        ui:TitleBar.ButtonCloseAvailability="Disabled"
        ui:TitleBar.ButtonMaximizeAvailability="Collapsed"
        ui:TitleBar.ButtonMinimizeAvailability="Auto"
        FontSize="14"
        Title="MainWindow" Height="540" Width="800">
    <Grid>
    </Grid>
</Window>

Also, I will notify you when this feature releases.

biocross commented 3 months ago

Thank you so much! Will wait for the release 🙏

NotYoojun commented 2 months ago

Hi there, I have published the release, pls check out! If you have any questions, feel free to reopen this or create a new issue.