Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
Hello I'am new to WPF, I've added (Microsoft.Windows.Shell.dll) Reference
and used this code :
XML
<Window x:Class="MyLibrary.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell"
        Title="MainWindow"
        WindowStyle="SingleBorderWindow"
        ResizeMode="CanResizeWithGrip"
        mc:Ignorable="d"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        d:DesignHeight="449"
        d:DesignWidth="677"
        Foreground="White">

    <shell:WindowChrome.WindowChrome>
        <shell:WindowChrome CaptionHeight="35"
                            GlassFrameThickness="0,0,0,1"
                            ResizeBorderThickness="5" />
    </shell:WindowChrome.WindowChrome>

    <Grid x:Name="LayoutRoot">

    </Grid>
</Window>


But Im getting 2 errors says :
Error	1	The attachable property 'WindowChrome' was not found in type 'WindowChrome'.<br />


And the Second is :
Error	2	The type 'shell:WindowChrome' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.<br />

what should I do to fix it? I am trying to make a custom style with DWN effects without using other than xaml code.
Posted
Updated 16-Jan-13 19:04pm
v2
Comments
MuthukaruppanP 27-Aug-13 16:26pm    
Have a look at
http://blogs.msdn.com/b/wpfsdk/archive/2010/08/25/experiments-with-windowchrome.aspx

1 solution

I had the exact same errors as you. No idea why.

I did the following to fix it:

- closed the project
- deleted the obj and bin folders
- reloaded the project
- put the DLL back in the bin folder
- deleted the reference and re-added it.
- closed and reopened the forms that used the DLL.

Hope it works for you too!

B
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900