2011-03-05 36 views

回答

0

您可以重複使用樣式,無論是用於標註還是任何其他控件,方法是使其成爲資源並在以後引用它們。例如:

<Window 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" 
    x:Class="WpfApplication1.MainWindow"> 
    <Window.Resources> 
     <Style x:Key="MyCalloutStyle" TargetType="ed:Callout"> 
      <Setter Property="Fill" Value="Orange" /> 
     </Style> 
    </Window.Resources> 

    <Grid x:Name="LayoutRoot"> 
     <ed:Callout Style="{StaticResource MyCalloutStyle}" /> 
     <ed:Callout Style="{StaticResource MyCalloutStyle}" /> 
    </Grid> 
</Window> 
+0

謝謝,有幫助 – Igal 2011-03-06 20:47:46