2025-07-31 20:12:24 +08:00
<UserControl x:Class="AntDesignWPFDemo.Views.ToolTipView"
2025-07-11 09:20:23 +08:00
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2025-07-31 20:12:24 +08:00
xmlns:antd="https://github.com/ShrlAlgo/AntDesignWPF"
2025-07-11 09:20:23 +08:00
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
2025-07-31 20:12:24 +08:00
xmlns:viewmodels="clr-namespace:AntDesignWPFDemo.ViewModels"
2025-07-11 09:20:23 +08:00
mc:Ignorable="d"
2025-07-31 20:12:24 +08:00
d:DataContext="{d:DesignInstance Type=viewmodels:ToolTipViewModel}">
2025-07-11 09:20:23 +08:00
<ScrollViewer>
2025-07-31 20:12:24 +08:00
<Grid Margin="16,0">
2025-07-11 09:20:23 +08:00
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel>
2025-07-31 20:12:24 +08:00
<Label Content="Tooltip" Style="{StaticResource Ant.H1}" />
2025-07-11 09:20:23 +08:00
<TextBlock Style="{StaticResource Ant.P}" Text="A simple text popup tip." />
2025-07-31 20:12:24 +08:00
<Label Content="When To Use" Style="{StaticResource Ant.H2}" />
2025-07-11 09:20:23 +08:00
<TextBlock Style="{StaticResource Ant.P}" Text="The tip is shown on mouse enter, and is hidden on mouse leave. The Tooltip doesn't support complex text or operations.
To provide an explanation of a button/text/operation. It's often used instead of the html title attribute." />
2025-07-31 20:12:24 +08:00
<Label Content="Examples" Style="{StaticResource Ant.H2}" />
2025-07-11 09:20:23 +08:00
</StackPanel>
<Grid Grid.Row="1">
<Grid.Resources>
2025-07-12 23:31:32 +08:00
<Style TargetType="antd:AntButton">
2025-07-31 20:12:24 +08:00
<Setter Property="Margin" Value="8,0,0,8" />
2025-07-11 09:20:23 +08:00
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
2025-07-31 20:12:24 +08:00
<StackPanel Margin="8,0">
2025-07-11 09:20:23 +08:00
<antd:CodeBox Title="Basic">
2025-07-31 20:12:24 +08:00
<antd:CodeBox.Description>The simplest usage.</antd:CodeBox.Description>
2025-07-11 09:20:23 +08:00
<antd:CodeBox.Content>
2025-07-31 20:12:24 +08:00
<TextBlock Text="Tooltip will show when mouse enter."
ToolTip="prompt text"
ToolTipService.Placement="Top"
ToolTipService.ShowDuration="0" />
2025-07-11 09:20:23 +08:00
</antd:CodeBox.Content>
2025-07-31 20:12:24 +08:00
<antd:CodeBox.Code><ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Themes/Theme.xaml" />\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntDesignWPF"\n\n
<WrapPanel>
<antd:Switch IsChecked="True" />
</WrapPanel></antd:CodeBox.Code>
2025-07-11 09:20:23 +08:00
</antd:CodeBox>
<antd:CodeBox Title="Arrow pointing at the center">
2025-07-31 20:12:24 +08:00
<antd:CodeBox.Description>By specifying `arrowPointAtCenter` prop, the arrow will point to the center of the target element.</antd:CodeBox.Description>
2025-07-11 09:20:23 +08:00
<antd:CodeBox.Content>
<StackPanel>
<WrapPanel>
2025-07-12 23:31:32 +08:00
<antd:AntButton Content="Align edge / 边缘对齐" />
2025-07-11 09:20:23 +08:00
</WrapPanel>
<WrapPanel>
2025-07-12 23:31:32 +08:00
<antd:AntButton Content="Arrow points to center / 箭头指向中心" />
2025-07-11 09:20:23 +08:00
</WrapPanel>
</StackPanel>
</antd:CodeBox.Content>
2025-07-31 20:12:24 +08:00
<antd:CodeBox.Code><ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Themes/Theme.xaml" />\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntDesignWPF"\n\n
<WrapPanel>
<antd:Switch IsChecked="True" />
</WrapPanel></antd:CodeBox.Code>
2025-07-11 09:20:23 +08:00
</antd:CodeBox>
</StackPanel>
2025-07-31 20:12:24 +08:00
<StackPanel Grid.Column="1" Margin="8,0">
2025-07-11 09:20:23 +08:00
<antd:CodeBox Title="Placement">
2025-07-31 20:12:24 +08:00
<antd:CodeBox.Description>The ToolTip has 12 placements choice. ToolTipService.Placement="Left"</antd:CodeBox.Description>
2025-07-11 09:20:23 +08:00
<antd:CodeBox.Content>
<Grid MaxWidth="335">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<WrapPanel HorizontalAlignment="Center">
2025-07-31 20:12:24 +08:00
<antd:AntButton Content="TL" ToolTip="Prompt Text" ToolTipService.Placement="Top"/>
<antd:AntButton Content="Top" ToolTip="Prompt Text" ToolTipService.Placement="Top"/>
<antd:AntButton Content="TR" ToolTip="Prompt Text" ToolTipService.Placement="Top"/>
2025-07-11 09:20:23 +08:00
</WrapPanel>
<StackPanel Grid.Row="1" HorizontalAlignment="Left">
2025-07-31 20:12:24 +08:00
<antd:AntButton Content="LT" ToolTip="Prompt Text" ToolTipService.Placement="Left"/>
<antd:AntButton Content="Left" ToolTip="Prompt Text" ToolTipService.Placement="Left"/>
<antd:AntButton Content="LB" ToolTip="Prompt Text" ToolTipService.Placement="Left"/>
2025-07-11 09:20:23 +08:00
</StackPanel>
<StackPanel Grid.Row="1" HorizontalAlignment="Right">
2025-07-31 20:12:24 +08:00
<antd:AntButton Content="RT" ToolTip="Prompt Text" ToolTipService.Placement="Right"/>
<antd:AntButton Content="Right" ToolTip="Prompt Text" ToolTipService.Placement="Right"/>
<antd:AntButton Content="RB" ToolTip="Prompt Text" ToolTipService.Placement="Right"/>
2025-07-11 09:20:23 +08:00
</StackPanel>
<WrapPanel Grid.Row="2" HorizontalAlignment="Center">
2025-07-31 20:12:24 +08:00
<antd:AntButton Content="BL" ToolTip="Prompt Text" ToolTipService.Placement="Center"/>
<antd:AntButton Content="Bottom" ToolTip="Prompt Text" ToolTipService.Placement="Center"/>
<antd:AntButton Content="BR" ToolTip="Prompt Text" ToolTipService.Placement="Center"/>
2025-07-11 09:20:23 +08:00
</WrapPanel>
</Grid>
</antd:CodeBox.Content>
2025-07-31 20:12:24 +08:00
<antd:CodeBox.Code><ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Themes/Theme.xaml" />\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntDesignWPF"\n\n
<WrapPanel>
<antd:Switch IsChecked="True" />
</WrapPanel></antd:CodeBox.Code>
2025-07-11 09:20:23 +08:00
</antd:CodeBox>
</StackPanel>
</Grid>
</Grid>
</ScrollViewer>
2025-07-31 20:12:24 +08:00
</UserControl>