我正在WPF应用程序中使用“反馈”选项。主窗口下面有TabControl和状态栏。状态栏上有一个按钮,可显示带有动画的FeedBackView。
因此,FeedBackView不是一个窗口,而是一个UserControl,它包含在Canvas Border中。
该应用程序具有一些选项,可打开其他模式窗口,因此此时无法使用“反馈”形式。我试图将Panel.ZIndex设置为1,但这没有帮助。那么,有什么方法可以在应用程序中将表单设置为最高级别?
<UserControl x:Class="UPR.Wpf.App.Views.StatusBarContentView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:v="clr-namespace:UPR.Wpf.App.Views.FeedBack"
xmlns:vm="clr-namespace:UPR.Wpf.App"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Styles/Buttons.xaml"/>
</ResourceDictionary.MergedDictionaries>
<BooleanToVisibilityConverter x:Key="xBooleanToVisibilityConverter"/>
</ResourceDictionary>
</UserControl.Resources>
<Canvas>
<Button Name="FeedBackButton"
Click="FeedBackButton_Click"
Loaded="FeedBackButton_Loaded"
BorderThickness="0.5"
BorderBrush="Gray"
Foreground="White"
FontWeight="Bold"
FontSize="15"
Height="32"
Canvas.Bottom="-17"
Canvas.Right="-150">
</Button>
<Border BorderBrush="Gray"
Panel.ZIndex="1"
BorderThickness="2"
Name="border"
Margin="-350,0,-178,-9"
Background="White"
Canvas.Bottom="24"
Canvas.Right="-5"
SizeChanged="border_SizeChanged">
<v:FeedBackView/>
</Border>
</Canvas>
</UserControl>