चलें कहते हैं कि मैं नीचे है:Style.Triggers कैसे बनाने के लिए एक अलग नाम दिया शैली लागू करने के लिए गति प्रदान
<Style TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Gray" />
<Style.Triggers>
<Trigger Property="IsFocused" Value="true">
<Setter Property="BorderBrush" Value="Green" />
<Setter Property="BorderThickness" Value="2" />
</Trigger>
</Style.Triggers>
</Style>
यह ठीक काम करता है और यहाँ बहुत ज्यादा कुछ भी गलत नहीं है, लेकिन यह एक अत्यंत साधारण मामला है । अगर मैं एक exsplicit शैली कैसे उस शैली को संदर्भित IsFocused शैली होने के रूप में कर के रूप में सूचीबद्ध IsFocused शैली राज्य करना चाहते हैं तो क्या होता है, यानी
<Style x:key="ActiveStyle" TargetType="{x:Type TextBox}">
<Setter Property="BorderBrush" Value="Green" />
<Setter Property="BorderThickness" Value="2" />
</Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Gray" />
<Style.Triggers>
<Trigger Property="IsFocused" Value="true">
-- Here I want to reference ActiveStyle and not copy the copy the setters
</Trigger>
</Style.Triggers>
</Style>
आदर्श नहीं मैं मानता हूँ:
तो फिर तुम उस में चलाता साथ टेक्स्ट बॉक्स की एक डिफ़ॉल्ट शैली बनाने लेकिन धन्यवाद – vdhant