Pen.DashStyle Proprietà

Definizione

Ottiene o imposta un valore che descrive il motivo di trattini generato dall'oggetto Pen.

public:
 property System::Windows::Media::DashStyle ^ DashStyle { System::Windows::Media::DashStyle ^ get(); void set(System::Windows::Media::DashStyle ^ value); };
public System.Windows.Media.DashStyle DashStyle { get; set; }
member this.DashStyle : System.Windows.Media.DashStyle with get, set
Public Property DashStyle As DashStyle

Valore della proprietà

Valore che descrive il motivo di trattini generato dall'oggetto Pen. L'impostazione predefinita è Solid, che indica che non sono presenti trattini.

Esempio

Nell'esempio seguente viene illustrato come utilizzare la DashStyle proprietà di un Pen oggetto per creare una linea tratteggiata sotto il testo.

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
  <StackPanel Margin="20">

    <TextBlock FontSize="36">
      the lazy brown dog.
      <TextBlock.TextDecorations>
        <TextDecoration Location="Underline"  
          PenThicknessUnit="FontRecommended">
          <TextDecoration.Pen>
            <Pen Thickness="1.5" Brush="Red" >

              <!-- For the underline, create a dashed line with each
                   dash twice the thickness of the Pen and each gap 8 times
                   the thickness of the Pen. -->
              <Pen.DashStyle>
                <DashStyle Dashes="2,8"/>
              </Pen.DashStyle>
            </Pen>
          </TextDecoration.Pen>
        </TextDecoration>
      </TextBlock.TextDecorations>
    </TextBlock>
  </StackPanel>
</Page>

Commenti

La DashStyles classe fornisce un set di modelli trattini predefiniti.

Informazioni proprietà di dipendenza

Campo Identificatore DashStyleProperty
Proprietà dei metadati impostate su true Nessuno

Si applica a

Vedi anche