我想在xaml文本框中创建提示文本并设置提示文本颜色。有没有办法直接在xaml文件中设置文本框中的提示文本和提示文本颜色?请告诉我怎么走。
发布于 2020-07-03 08:10:41
我使用MaterialDesignThemes。下载NuGet并按如下所示提供给我们:
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
<TextBox materialDesign:HintAssist.Hint="Floating Hint" Style="{StaticResource MaterialDesignFloatingHintTextBox}" VerticalAlignment="Center"/>您还需要在App.xaml中进行以下更改
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.DeepPurple.xaml" />
</ResourceDictionary.MergedDictionaries>MaterialDesign Getting Started
https://stackoverflow.com/questions/62706639
复制相似问题