में सभी व्युत्पन्न कक्षाओं में एक शैली को लागू करना मैं नियंत्रण से प्राप्त सभी वर्गों में एक शैली लागू करना चाहता हूं। क्या यह WPF के साथ संभव है? निम्नलिखित उदाहरण काम नहीं करता है। मैं लेबल, टेक्स्ट बॉक्स और बटन चाहते हैं 4.WPF
<Window x:Class="WeatherInfo.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Wetterbericht" Height="300" Width="300">
<Window.Resources>
<Style TargetType="Control">
<Setter Property="Margin" Value="4"/>
</Style>
</Window.Resources>
<Grid>
<StackPanel Margin="4" HorizontalAlignment="Left">
<Label>Zipcode</Label>
<TextBox Name="Zipcode"></TextBox>
<Button>get weather info</Button>
</StackPanel>
</Grid>
</Window>
काम करता है ... धन्यवाद। – Sebastian