相关疑难解决方法(0)

如何将工具提示的可见性绑定到textblock中的文本?

<DataGrid x:Name="dgRecords1"
          CanUserAddRows="False" IsReadOnly="True"
          ColumnHeaderStyle="{DynamicResource DataGridColumnHeaderStyle1}"
          Style="{DynamicResource StyleDatagrid}"
          SelectionChanged="dgRecords1_SelectionChanged"
          Height="251" Width="569" Margin="41,173,168,0">
  <DataGrid.RowStyle>
    <Style TargetType="DataGridRow">
      <Setter Property="ToolTip">
        <Setter.Value>
          <Border Width="200" Height="80"
                  BorderBrush="Black" BorderThickness="1"
                  Background="AliceBlue">
            <StackPanel Orientation="Vertical">
              <StackPanel Height="30" Background="Black">
                <TextBlock Text="Email Sent To"
                           FontSize="14" FontWeight="Bold" Foreground="White"/>
              </StackPanel>
              <StackPanel>
                <TextBlock Text="{Binding SentToList}"
                           TextWrapping="Wrap" FontWeight="Bold"/>
              </StackPanel>
            </StackPanel>
          </Border>
        </Setter.Value>
      </Setter>
    </Style>
  </DataGrid.RowStyle>
Run Code Online (Sandbox Code Playgroud)

在上面的代码中,

   <TextBlock TextWrapping="Wrap" FontWeight="Bold" Text="{Binding SentToList}" />
Run Code Online (Sandbox Code Playgroud)

我想检查这个文本块中是否有东西,如果没有,我需要使工具提示不可见.有没有办法使用触发器?

wpf xaml tooltip

0
推荐指数
1
解决办法
1859
查看次数

标签 统计

tooltip ×1

wpf ×1

xaml ×1