Somehow Border
within ControlTemplate
of PasswordBox
does not take MyControlBorder
style.
When you modify MyPasswordBox
style like this... then it will work.
<Style x:Key="MyPasswordBox" TargetType="{x:Type PasswordBox}">
<Setter Property="Height" Value="30" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Control}">
<Border Name="Border" BorderBrush="DarkKhaki" Background="White" BorderThickness="1" CornerRadius="10">
<ScrollViewer x:Name="PART_ContentHost" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
I know it's not the best solution... but I can't figure out why MyControlBorder
is not applied. It doesn't even work when you get rid of MyTextBox
style. Then you are left only with MyControlBorder
and MyPasswordBox
...it does not work either.