FluentWPF icon indicating copy to clipboard operation
FluentWPF copied to clipboard

RevealBrush does not work in TitleBar

Open ghost opened this issue 5 years ago • 2 comments

Good day, I noticed that RevealBrush in TitleBar doesn't work. see picture: gif_06

ghost avatar Dec 21 '19 23:12 ghost

Hi, @ORRNY66

Thanks for the feedback, and sorry for responding so late. RevealBrush needs fw:PointerTracker.Enabled="True" attached property in a parent panel.

Please add following properties to the parent panel.

  • fw:PointerTracker.Enabled="True" attached property
  • Any colors to Background property

I recommend adding fw:PointerTracker.Enabled to Window element.

Please see below.

<fw:AcrylicWindow x:Class="FluentWPFSample.Views.AcrylicWindow4"
                  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:fw="clr-namespace:SourceChord.FluentWPF;assembly=FluentWPF"
                  xmlns:local="clr-namespace:FluentWPFSample.Views"
                  mc:Ignorable="d"
                  Title="AcrylicWindow4" Height="450" Width="800" TitleBarMode="Extend"
                  fw:PointerTracker.Enabled="True" Background="Transparent">
    <fw:AcrylicWindow.TitleBar>
        <fw:DropShadowPanel ShadowMode="Outer" BlurRadius="8" ShadowOpacity="0.6">
            <Grid WindowChrome.IsHitTestVisibleInChrome="True">
                <Button Content="Button" HorizontalAlignment="Left" Margin="5" Width="75" Height="32"
                        Style="{StaticResource ButtonRevealStyle}"/>
            </Grid>
        </fw:DropShadowPanel>
    </fw:AcrylicWindow.TitleBar>
    <Grid>
        
    </Grid>
</fw:AcrylicWindow>

The key factor is fw:PointerTracker.Enabled="True" attached property, but it is very confusing and boring work. I'd like to improve the prepalations for using RevealBrush. It may be changed in the future update.

sourcechord avatar Feb 09 '20 08:02 sourcechord

I tried your approach, and RevealBrush works as long as you dont hover over the button. Once you hover over the TitleBar it loses the property, meaning no more RevealBrush. Have to restart the app.

Edit: I tried it on your Sample app and it works there but little glitchy, because Reveal brush only works when mouse pointer not in TitleBar. When in TitleBar, there is no RevealBrush

SlackingVeteran avatar Mar 09 '20 11:03 SlackingVeteran