This is a migrated thread and some comments may be shown as answers.

Windows8Theme and PasswordBox

4 Answers 106 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lukasz
Top achievements
Rank 1
Lukasz asked on 08 Dec 2015, 09:06 AM

Hi,

I created a form that has RadMaskedTextInput, CheckBox and PasswordBox.

I am using noxaml binaries and added styles for native wpf windows controls this way:

<ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Telerik.Windows.Themes.Windows8;component/Themes/System.Windows.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
        <ResourceDictionary Source="Resources/CommonStyles.xaml"/>
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

CheckBox is styled correctly. Unfortunately PasswordBox is not. It has smaller height and a border that looks strange. See Image here:

Screenshot

Is there a better way than setting form, removing border ?

Thanks,

Łukasz

4 Answers, 1 is accepted

Sort by
0
Lukasz
Top achievements
Rank 1
answered on 08 Dec 2015, 09:09 AM

Xaml code:

<telerik:Label Grid.Row="0" Grid.Column="0">PIN:</telerik:Label>
<telerik:RadMaskedTextInput Grid.Row="0" Grid.Column="1" Mask="" Value="{Binding Username}" HorizontalAlignment="Stretch"/>
 
<telerik:Label Grid.Row="1" Grid.Column="0">Hasło:</telerik:Label>
<PasswordBox Grid.Row="1" Grid.Column="1"/>
 
<CheckBox Grid.Row="2" Grid.ColumnSpan="2"  Content="zapisz hasło" HorizontalAlignment="Right"/>

0
Masha
Telerik team
answered on 09 Dec 2015, 08:09 AM
Hello Lukasz,

I guess some native styles are mismatched ant that is the reason for broken password box. Can you share the content of  CommonStyles.xaml so we can find what may be the source of the problem.

Looking forward to receiving your reply.

Regards,
Masha
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Lukasz
Top achievements
Rank 1
answered on 09 Dec 2015, 08:33 AM

Ok, you are right - thanks for pointing me in right direction.

 In my CommonStyles.xaml i had:

<Style TargetType="{x:Type telerik:RadMaskedTextInput}" BasedOn="{StaticResource RadMaskedTextInputStyle}">
    <Setter Property="Margin" Value="3"/>
</Style>
 
<Style TargetType="{x:Type PasswordBox}">
    <Setter Property="Margin" Value="3"/>
</Style>

It looks like I am missing BasedOn="?" for PasswordBox. But what can I put there?

0
Masha
Telerik team
answered on 11 Dec 2015, 09:19 AM
Hi Lukasz,

Can you try the following code snippet:

<Style TargetType="{x:Type PasswordBox}" BasedOn="{StaticResource PasswordBoxStyle}">
    <Setter Property="Margin" Value="3"/>
</Style>

This should fix the issue. I hope this helps.

Regards,
Masha
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Lukasz
Top achievements
Rank 1
Answers by
Lukasz
Top achievements
Rank 1
Masha
Telerik team
Share this question
or