LoginSignup
1
1

More than 1 year has passed since last update.

XAMLでTextboxプレースホルダー表示

Posted at

IsFocusedなしでvalueがない場合はプレースホリダーのように表示するメモ

<MultiDataTrigger>
  <MultiDataTrigger.Conditions>
    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type TextBox}}, Path=Text}" Value="" />
    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type TextBox}}, Path=IsFocused}" Value="False" />
  </MultiDataTrigger.Conditions>
  <Setter Property="Foreground" Value="#33000000" />
  <Setter Property="Visibility" Value="Visible" />
</MultiDataTrigger>

参考URL

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1