Aracılığıyla paylaş


Setter.Property Özellik

Tanım

uygulanacağı özelliği Value alır veya ayarlar.

public:
 property System::Windows::DependencyProperty ^ Property { System::Windows::DependencyProperty ^ get(); void set(System::Windows::DependencyProperty ^ value); };
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Modifiability=System.Windows.Modifiability.Unmodifiable, Readability=System.Windows.Readability.Unreadable)]
[System.Windows.Markup.Ambient]
public System.Windows.DependencyProperty Property { get; set; }
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None, Modifiability=System.Windows.Modifiability.Unmodifiable, Readability=System.Windows.Readability.Unreadable)>]
[<System.Windows.Markup.Ambient>]
member this.Property : System.Windows.DependencyProperty with get, set
Public Property Property As DependencyProperty

Özellik Değeri

DependencyProperty Value uygulanacağı A. Varsayılan değer null'tır.

Öznitelikler

Özel durumlar

Property özelliği olamaznull.

Belirtilen Property özellik salt okunur olamaz.

Belirtilen, belirtilen Value türü Propertyiçin geçerli değilse.

Örnekler

Aşağıdaki örnek, her TextBlock öğeye uygulanacak bir stil tanımlar.

<Style TargetType="{x:Type TextBlock}">
  <Setter Property="FontFamily" Value="Segoe Black" />
  <Setter Property="HorizontalAlignment" Value="Center" />
  <Setter Property="FontSize" Value="12pt" />
  <Setter Property="Foreground" Value="#777777" />
</Style>

Aşağıdaki örnekte, özelliğini etkileyecek Background bir Controlstil bildirimi gösterilmektedir. bu örnekteki özellik adının sınıfıControl () adıyla nitelendiğini, çünkü öğesinin Style belirtmediğini TargetTypeunutmayın.

<Style x:Key="Style1">
  <Setter Property="Control.Background" Value="Yellow"/>
</Style>

Açıklamalar

bir veya özel durum oluşturulacak hem Setter ve ValueProperty özelliklerini belirtmeniz gerektiğini unutmayın.

Şunlara uygulanır

Ayrıca bkz.