我正在编写一个 kinect 应用程序,它需要我使用手并充当鼠标,我已经完成了这称为悬停按钮。有什么办法可以让我的主窗口中的悬停按钮也可以在我的子窗口上工作?
<Window x:Class="KinectButton.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:Coding4Fun.Kinect.Wpf.Controls;assembly=Coding4Fun.Kinect.Wpf"
Title="MainWindow" Background="#FFAD4747"
WindowStyle="None" ResizeMode="NoResize"
WindowStartupLocation="CenterScreen" WindowState="Maximized" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="927" Width="1350">
<Grid x:Name="LayoutRoot">
<Canvas>
<Canvas.Background>
<ImageBrush ImageSource="file:///C:/Users/103159T/Downloads/STORYBOARD/Background.png" />
</Canvas.Background>
<Controls:HoverButton Margin="0" Padding="0" x:Name="kinectButton" ImageSize="50"
ImageSource="/Images/RightHand.png"
ActiveImageSource="/Images/RightHand.png"
TimeInterval="2000" Panel.ZIndex="1000" Canvas.Left="0" Canvas.Top="0" />
<Button x:Name="button1" Content="START" Height="152" Canvas.Left="594" Canvas.Top="502" Width="320" FontSize="40" Click="button1_Click" BorderThickness="4" Foreground="White" FontFamily="Comic Sans MS" OpacityMask="Black" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF0000C8" Offset="0.358" />
<GradientStop Color="White" Offset="1" />
</LinearGradientBrush>
</Button.Background>
</Button>
<Label Canvas.Left="384" Canvas.Top="632" Content="" Height="66" Name="message" Width="530" Foreground="White" FontSize="40" />
<Button Canvas.Left="0" Canvas.Top="974" Content="Quit" Height="91" Name="quitButton" Width="137" FontSize="28" Background="#FFFF3838" Foreground="White" Click="quitButton_Click" />
<Image Height="206" Name="videoStream" Stretch="Fill" Width="363" Canvas.Left="1002" Canvas.Top="682" />
</Canvas>
</Grid>
那是我的主窗口 xaml,其中包括一个名为“START”的按钮,单击该按钮会将我引导到另一个 xaml 窗口。