日期:2014-05-18 浏览次数:21124 次
<Window
Height="221" Width="220" WindowStyle="None"
WindowStartupLocation="CenterScreen"
AllowsTransparency="True">
<Style x:Key="Wnd_220x221" TargetType="Window">
<Setter Property="Width" Value="220"/>
<Setter Property="Height" Value="221"/>
<Setter Property="WindowStyle" Value="None"/>
</Style>
<Window
style="Wnd_220x221"
WindowStartupLocation="CenterScreen"
AllowsTransparency="True">
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="..xxxx.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
------解决方案--------------------
思路没错,但是基础不稳
http://www.cnblogs.com/Zhouyongh/archive/2011/08/01/2123610.html
------解决方案--------------------
style={StaticResource Wnd_220x221}
前提是你把这个Style加载进来
加载办法,
1. 新建Style.xaml的ResourceDictionary
2. 然后通过App.xaml加入
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Style.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>