Windows8Theme and PasswordBox

5 posts, 0 answers
  1. Lukasz
    Lukasz avatar
    21 posts
    Member since:
    Aug 2014

    Posted 08 Dec 2015 Link to this post

    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

  2. Lukasz
    Lukasz avatar
    21 posts
    Member since:
    Aug 2014

    Posted 08 Dec 2015 in reply to Lukasz Link to this post

    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"/>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Masha
    Admin
    Masha avatar
    355 posts

    Posted 09 Dec 2015 Link to this post

    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
  5. Lukasz
    Lukasz avatar
    21 posts
    Member since:
    Aug 2014

    Posted 09 Dec 2015 in reply to Masha Link to this post

    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?

  6. Masha
    Admin
    Masha avatar
    355 posts

    Posted 11 Dec 2015 Link to this post

    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
Back to Top
UI for WPF is Visual Studio 2017 Ready