-1

So I found this while I was searching for ways to get borderless wpf forms to drop a shadow. It creates a drop shadow like that of visual studio or microsoft office. After downloading from the mentioned site, I've referenced the WindowGlows.dll file in my project and copied this code from the example on the sight.

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:WindowGlows="http://GlowWindow.codeplex.com/"
    x:Class="WindowGlowsTestApp.MainWindow"
    Title="MainWindow"
    Height="350"
    Width="525"
    WindowGlows:GlowManager.EnableGlow="True"
    WindowGlows:GlowManager.ActiveGlowBrush="CornflowerBlue"
    WindowGlows:GlowManager.InactiveGlowBrush="LightGray">
<WindowChrome.WindowChrome>
    <WindowChrome GlassFrameThickness="0"
                  CornerRadius="0"
                  CaptionHeight="36"
                  ResizeBorderThickness="0" />
</WindowChrome.WindowChrome>
<Border BorderThickness="1"
        BorderBrush="{Binding Path=(WindowGlows:GlowManager.ActiveGlowBrush),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="36" />
            <RowDefinition />
            <RowDefinition Height="24" />
        </Grid.RowDefinitions>
        <Rectangle Fill="{Binding Path=(WindowGlows:GlowManager.ActiveGlowBrush),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}"
                   Margin="-1,11,-1,0"
                   StrokeThickness="0"
                   ClipToBounds="True" />
        <TextBlock HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   Text="{Binding Title, RelativeSource={RelativeSource AncestorType={x:Type Window}, Mode=FindAncestor}}"
                   Foreground="{Binding Path=(WindowGlows:GlowManager.InactiveGlowBrush),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}"
                   Margin="0,11,0,0" />
        <Rectangle Grid.Row="2"
                   Fill="{Binding Path=(WindowGlows:GlowManager.ActiveGlowBrush),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}"
                   Margin="-1,0,-1,-1"
                   StrokeThickness="0"
                   ClipToBounds="True" />
    </Grid>
</Border>

When I click start, the form drops a fantastic shadow and I can put this to great use but I can't get rid of the errors, which tell me

Error   1   The name "GlowManager" does not exist in the namespace

I get 6 more errors about glow manager but nothing else, how do I correct the namespace?

Ryan Codrai
  • 172
  • 8
  • What's your actual question? – Jeffrey Bosboom Dec 23 '14 at 02:29
  • Why isn't the namespace valid, until I resolve the errors the xmal is an invalid markup and I can't work in design view, i've tried visiting [this page](http://msdn.microsoft.com/en-us/library/ms747086%28v=vs.110%29.aspx) and tried some things from there but to no avail. – Ryan Codrai Dec 23 '14 at 02:54

2 Answers2

0

That namespace doesn't look right to me.

Assuming you have availed reference in your project to the doll, the easiest way to get these right is to use blend, from assets tab drop in a object from that DSL and it will do the rest. visual studio is a little less helpful.

Without seeing exactly what you've got, the best I can offer is change the namespace tag to something of this form...

Xmlns:windowchrome="clr-namespace:<namespace of targeted objects>,assembly=<assembly name as seen in references folder>"

msdn includes some more details, http://msdn.microsoft.com/en-gb/library/bb514546%28v=vs.90%29.aspx

kidshaw
  • 3,423
  • 2
  • 16
  • 28
  • I tried that way of declaring the namespace but I didn't get any success, that tip for blend will come in really handy though... – Ryan Codrai Dec 23 '14 at 14:12
  • Just noticed I had a space in that namespace element. Will edit for clarity but glad the blend tip helps at least. – kidshaw Dec 23 '14 at 14:14
0

After reading this link I copied the entire project straight into the root of my C drive and opened it from there, it works absolutely fine now. Looks like it's a visual studio bug if anything.

Community
  • 1
  • 1
Ryan Codrai
  • 172
  • 8