www.pudn.com > wpfwin7.rar > MyComputer.xaml, change:2012-05-10,size:2934b


<Window x:Class="MyWindow.MyComputer" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        Title="我的电脑" Height="430" Width="764" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" Style="{DynamicResource windowStyle}"> 
    <!--修改窗体默认样式--> 
    <Window.Resources> 
        <Style  x:Key="windowStyle" TargetType="{x:Type Window}"> 
            <Setter Property="AllowsTransparency" Value="true"/> 
            <Setter Property="Background" Value="Transparent"/> 
            <Setter Property="FontFamily" Value="Consolas, Microsoft YaHei"/> 
            <!--<Setter Property="FontSize" Value="16"/>--> 
            <Setter Property="ResizeMode" Value="NoResize"/> 
            <Setter Property="WindowStyle" Value="None"/> 
            <Setter Property="Opacity" Value="0.7"/> 
            <Setter Property="Template"> 
                <Setter.Value> 
                    <ControlTemplate x:Name="winContent" TargetType="{x:Type Window}"> 
                        <Grid Margin="20"> 
                            <!--红色阴影--> 
                            <Rectangle Fill="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"   
                               RadiusX="0" RadiusY="0"> 
                                <Rectangle.Effect> 
                                    <DropShadowEffect BlurRadius="20" Color="Red" ShadowDepth="0"/> 
                                </Rectangle.Effect> 
                            </Rectangle> 
                            <Border BorderBrush="White" 
                                BorderThickness="1" 
                                Padding="{TemplateBinding Margin}" 
                                Background="LightBlue" 
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                CornerRadius="0"> 
                                <StackPanel> 
                                    <StackPanel Orientation="Horizontal"> 
                                        <Label>我的电脑</Label><!--title--> 
                                        <Label ToolTip="Close" Margin="625,0,0,0" Foreground="Red" MouseLeftButtonDown="Label_MouseLeftButtonDown">X</Label>                                         
                                    </StackPanel>                                     
                                    <ContentPresenter /> <!--界面内容展现容器--> 
                                </StackPanel> 
                                 
                                 
                            </Border> 
                        </Grid> 
                    </ControlTemplate> 
                </Setter.Value> 
            </Setter> 
        </Style> 
    </Window.Resources> 
    <Grid> 
        <Image  Source="4.png"></Image > 
    </Grid> 
</Window>