app.xaml内容======================
<Application xmlns="..." xmlns:local="...">
<Application.Resources>
<Style x:Name="DialogBoxStyle1" TargetType="local

ialogBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid x:Name="LayoutRoot">
...
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Application.Resources>
</Application>
DialogControlTest.xaml.cs================================
...
//从全局资源中获取名为DislogBoxStyle1的Style,成功
Style style = Application.Current.Resources["DialogBoxStyle1"] as Style;
//从Style中获取其中定义的template,
失败 ControlTemplate template = style.Setters[0] as ControlTemplate;
我要如何编码才能达到目的呢?