Material Design In XAML override style not working

强颜欢笑 提交于 2019-12-08 05:19:29

The issue is in MaterialDesignTheme.Overrides.xaml. You are specifying a specific style to override but not referencing the resource dictionary that contains that style. Merging it in will fix the problem.

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBox.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style BasedOn="{StaticResource MaterialDesignTextBox}"
           TargetType="{x:Type TextBox}">
        <Setter Property="FontSize" Value="200" />
    </Style>
</ResourceDictionary>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!