Lester's WPF\SL Blog

Simple, Easy & Beautiful

WPF Shell Integration Library

WPF Shell Integration Library

Rate This
  • Comments 3

One of the common complaints I have heard is that it is difficult to have a glass chrome like windows. Yeah, you could set the style to None, but then you would need to have code handling window behaviors like resize, close.... No more.. two of our devs (Adam Smith\Joe Castro) have written the WPF Shell integration library which allows you to do this very easily.. You can get the code\binaries from this link  

"The custom chrome feature allows applications control over the outer frame of the window so that WPF content can be drawn over the title bar. This allows applications to integrate with Aero glass to emulate the Office 2007/2010 look and feel, or to completely replace the frame with its own content without having to manage all the system behaviors that get lost when using WindowStyle.None" 

 

Code usage looks something like the below

<Style TargetType="{x:Type local:SelectableChromeWindow}">

    <Setter Property="shell:WindowChrome.WindowChrome">

        <Setter.Value>

            <shell:WindowChrome GlassFrameThickness="-1" />

        </Setter.Value>

    </Setter>

 

    <Setter Property="Template">

        <Setter.Value>

            <ControlTemplate TargetType="{x:Type local:SelectableChromeWindow}">

                <Grid>

                    <ContentPresenter Margin="40" Content="{TemplateBinding Content}"/>

                    <Button shell:WindowChrome.IsHitTestVisibleInChrome="True" Background="Transparent" ...

 

Code for the above sample is attached. Please note that the shell dll is not included. You will need to download the binary from the msdn site.

Share this post

 

Attachment: WindowChromeSample.zip
  • How is this library different from the Windows API Code Pack that Microsoft already provides?

    Thanks,

  • As mentioned on the site "This is a set of utilities to help WPF applications take greater advantage of the Windows shell"... The codepack gives direct access win7\vista features with no WPF'isms involved.

  • Hey Lester

    Great post...

    Keep them coming

Page 1 of 1 (3 items)