wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

Titlebar - cannot add custom button

Open bimbacz opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe

I need to add a custom button to the titlebar. I can't do it and I don't want to create my own component

Describe the solution you'd like

It would work best if you could add cutom buttons as a collection of elements

Describe alternatives you've considered

No response

Additional context

No response

bimbacz avatar Dec 27 '24 11:12 bimbacz

In 4.0, you can do this:

    <wpfui:TitleBar>
        <wpfui:TitleBar.Header>
            <wpfui:TextBlock Padding="10">Some text on the left</wpfui:TextBlock>
        </wpfui:TitleBar.Header>

        <wpfui:TitleBar.TrailingContent>
            <wpfui:TextBlock Padding="10">Some text on the right</wpfui:TextBlock>
        </wpfui:TitleBar.TrailingContent>
    </wpfui:TitleBar>

Which will produce a window like so:

Image

chucker avatar Feb 16 '25 19:02 chucker

The Header and TrailingContent work except for it disables click to select the window and move the window when user clicks on the area with TextBlock, even with IsHitTestVisible of the TextBlock set False.

xylieong avatar Feb 27 '25 01:02 xylieong

take a look at #1483 and its PR #1484 If that gets merged, you will be able to add content to the center of title bar too.

luca-domenichini avatar Jul 15 '25 20:07 luca-domenichini