У меня есть элемент управления Popover, для которого IsOpen установлено значение true при 2 условиях (когда свойство строки имеет значение, а IsMouse поверх элемента управления Ui имеет значение true). Popover должен открыться с задержкой в 0,3 секунды. Образец
<ContentControl Content = "{Binding}"
Background = "Transparent"
AutomationProperties.AutomationId = "xyz.ssd">
<ContentControl.Style>
<Style TargetType = "{x:Type ContentControl}">
<Setter Property = "FontSize" Value = "15" />
<Setter Property = "ContentTemplate">
<Setter.Value>
<DataTemplate>
<Border x:Name = "ertt">
<StackPanel x:Name = "Grid1" MouseEnter = "Image11_OnMouseEnter"
MouseLeave = "Image11_OnMouseLeave" MouseDown = "Grid1_OnMouseDown">
<Image Height = "60" Width = "60" Source = "{StaticResource SampleImage}"
ToolTip = "{Binding DataContext.SomeTextToDisplay , RelativeSource = {RelativeSource Mode=FindAncestor,
AncestorType=tlui:MainWindow} , Mode=TwoWay}"
DocumentViewerBase.IsMasterPage = "True"
x:Name = "Image11" >
</Image>
<controls:Popover
PlacementTarget = "{Binding ElementName=Image11}"
Placement = "Bottom" Height = "1" Width = "1"
FocusManager.IsFocusScope = "False"
controls:DialogWindowCloseBehavior.IsCloseButton = "False"
AllowDrop = "False"
AutomationProperties.IsOffscreenBehavior = "FromClip"
controls:BackgroundBlurBehavior.BackgroundBlur = "True"
controls:CultureBehavior.UseHarmonizedCulture = "False"
ArrowHeight = "1"
StaysOpen = "True"
x:Name = "SomePopover"
>
<!--<controls:Popover.IsOpen>
<MultiBinding Converter = "{StaticResource BooleanToVisibilityConverter}">
<Binding Path = "DataContext.SomeTextToDisplay"
RelativeSource = "{RelativeSource Mode=FindAncestor,
AncestorType=tlui:MainWindow}" />
<Binding Path = "IsPopOverOpen" RelativeSource = "{RelativeSource AncestorType=conv:UserControl1}"
/>
</MultiBinding>
</controls:Popover.IsOpen>-->
<controls:Popover.IsHitTestVisible>False</controls:Popover.IsHitTestVisible>
<controls:Popover.IsManipulationEnabled>False</controls:Popover.IsManipulationEnabled>
<controls:Popover.VerticalOffset>-1</controls:Popover.VerticalOffset>
<Border Margin = "10,0,0,0" ClipToBounds = "True">
<Border.Resources>
<Style TargetType = "{x:Type Border}">
<Setter Property = "Width" Value = "60" />
<Setter Property = "Height" Value = "60" />
<Setter Property = "VerticalAlignment" Value = "Center" />
<Setter Property = "HorizontalAlignment" Value = "Center" />
</Style>
</Border.Resources>
<StackPanel>
<TextBlock x:Name = "NotesComment"
TextWrapping = "Wrap">
<TextBlock.Text>
<Binding Path = "DataContext.SomeTextToDisplay"
RelativeSource = "{RelativeSource Mode=FindAncestor,
AncestorType=tlui:MainWindow}" />
</TextBlock.Text>
</TextBlock>
</StackPanel>
</Border>
</controls:Popover>
</StackPanel>
</Border>
<DataTemplate.Resources>
<Storyboard x:Key = "OpenPopOver">
<BooleanAnimationUsingKeyFrames
Storyboard.TargetName = "SomePopover"
Storyboard.TargetProperty = "IsOpen"
FillBehavior = "Stop">
<DiscreteBooleanKeyFrame KeyTime = "0:0:2.3" Value = "False"/>
</BooleanAnimationUsingKeyFrames>
</Storyboard>
</DataTemplate.Resources>
<DataTemplate.Triggers>
<Trigger SourceName = "ertt" Property = "IsMouseOver" Value = "True">
<Trigger.EnterActions>
<BeginStoryboard x:Name = "bsb" >
<Storyboard>
<BooleanAnimationUsingKeyFrames
Storyboard.TargetName = "SomePopover"
Storyboard.TargetProperty = "IsOpen"
FillBehavior = "HoldEnd">
<DiscreteBooleanKeyFrame KeyTime = "0:0:1.3"
Value = "{Binding ElementName=Image11 ,Path=ToolTip,
Converter = {x:Static converter:StringtoBool.Instance}}"/>
</BooleanAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<StopStoryboard BeginStoryboardName = "bsb"/>
<BeginStoryboard x:Name = "bxb" Storyboard = "{StaticResource OpenPopOver}"/>
</Trigger.ExitActions>
</Trigger>
<Trigger SourceName = "SomePopover" Property = "IsMouseOver" Value = "True">
<Trigger.EnterActions>
<StopStoryboard BeginStoryboardName = "bsb"/>
</Trigger.EnterActions>
<!--<Trigger.ExitActions>
<BeginStoryboard Storyboard = "{StaticResource OpenPopOver}"/>
<RemoveStoryboard BeginStoryboardName = "bxb"/>
</Trigger.ExitActions>-->
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</ContentControl.Style>
</ContentControl>
Проблема в том, что всякий раз, когда я нахожусь на элементе управления контентом, отображается всплывающее окно. Он должен отображаться, только если IsMouseOver на ContentControl имеет значение true И изображение (Image11) имеет всплывающую подсказку с описанием. Изображение не отображается в определенных сценариях. В этих сценариях всплывающее окно не должно открываться при наведении курсора на элемент управления контентом.
Также Popover должен открываться с задержкой в 1,3 секунды. Следовательно, я должен использовать раскадровку





Пожалуйста, помогите. Это немного срочно