בשמחה!
<Application.Resources>
<Style TargetType="HeaderedContentControl" >
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="HeaderedContentControl">
<Grid Margin="5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition SharedSizeGroup="col"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="{TemplateBinding Header}" Foreground="Indigo" Margin="10,0"/>
<ContentPresenter Grid.Column="1"/>
<ContentPresenter Grid.Column="1"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="TextBox" >
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Width" Value="120" />
</Style>
<Style TargetType="WrapPanel" >
<Setter Property="Margin" Value="5,0"/>
<Setter Property="Orientation" Value="Vertical"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="Window">
<Setter Property="Background" Value="LightSteelBlue"/>
</Style>
<Style TargetType="Button">
<Setter Property="Margin" Value="10,2"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="14"/>
</Style>
</Application.Resources>
כאן זה אחרי שמחקתי את הkey שלהם, ואז הVS מזהה אוט' ומחיל את הסטיייל אוט' על כל מסכי האפליקציה.
כך שבעצם ע"י זה אני עוקף את הבעיה.
מצד שני, בתוכנה אחרת שניסיתי להשתמש בזה - זה לא עבד לי באופן אוט' ולכן בהתחלה ניסיתי להשתמש עכשיו בkey ואח"כ להפנות אליו מכל חלון, וקיבלתי את השגיאה הנ"ל.. אחרי שמחקתי את הKEY אז הוא זיהה לי באופן אוט'.
תודה רבה!
פורסם במקור בפורום CODE613 ב24/08/2015 18:45 (+03:00)