mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 18:01:26 +08:00
fix: TooltipBlock 无法使用 binding
This commit is contained in:
@@ -3,10 +3,8 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding"
|
||||
xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DataContext="{d:DesignInstance {x:Type controls:TooltipBlock}}"
|
||||
mc:Ignorable="d">
|
||||
<Border
|
||||
Width="15"
|
||||
@@ -15,9 +13,10 @@
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Background="{DynamicResource MouseOverRegionBrushOpacity75}"
|
||||
DataContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
|
||||
Style="{StaticResource BorderCircular}"
|
||||
ToolTipService.InitialShowDelay="{Binding InitialShowDelay}"
|
||||
ToolTipService.IsEnabled="{c:Binding 'TooltipTextEmpty ? \'False\' : \'True\''}">
|
||||
ToolTipService.IsEnabled="{c:Binding !TooltipTextEmpty}">
|
||||
<Border.ToolTip>
|
||||
<TextBlock
|
||||
MaxWidth="{Binding TooltipMaxWidth}"
|
||||
|
||||
@@ -27,7 +27,6 @@ public partial class TooltipBlock : UserControl
|
||||
public TooltipBlock()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
|
||||
Opacity = NormalOpacity;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user