简体   繁体   English

Windows 10 UWP PointerExited不会在触摸屏上触发

[英]windows 10 UWP PointerExited does not trigger on touch screen

I'm using PointerEntered and PointerExited on my grid to change it's color when pointer is inside, and sometimes (most of time) PointerExited does not trigger on my w10m phone, I used break point to check that. 我在我的网格上使用PointerEntered和PointerExited来改变指针在里面的颜色,有时(大部分时间)PointerExited不会在我的w10m手机上触发,我用断点检查它。 Same with Poiner(Canceled/CaptureLost). 与Poiner相同(Canceled / CaptureLost)。 It doesn't trigger even if I touch outside the grid, when pointer is 100% outside. 即使我在网格外触摸,当指针在外面100%时,它也不会触发。

Any ideas how to fix that? 任何想法如何解决?

My code (if needed): 我的代码(如果需要):

        private void ButtonPointerEntered(object sender, PointerRoutedEventArgs e)
        {
            var c = (ButtonGrid.Background as SolidColorBrush).Color;
            ButtonGrid.Background = new SolidColorBrush(Color.FromArgb(60, c.R, c.G, c.B));
        }

        private void ButtonPointerExited(object sender, PointerRoutedEventArgs e) //Does not trigger
        {
            var c = (ButtonGrid.Background as SolidColorBrush).Color;
            ButtonGrid.Background = new SolidColorBrush(Color.FromArgb(0, c.R, c.G, c.B));
        }

XAML: XAML:

            <Grid PointerEntered="ButtonPointerEntered" Tapped="ButtonTapped"  x:Name="ButtonGrid" Background="{ThemeResource ApplicationForegroundThemeBrush}" PointerExited="ButtonPointerExited">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <TextBlock x:Name="IconTB" FontFamily="Segoe MDL2 Assets" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,3,0,0"/>
                <TextBlock x:Name="TextTB" Grid.Row="1"  FontSize="13" HorizontalAlignment="Center" TextWrapping="WrapWholeWords" TextAlignment="Center" Margin="0,0,0,2"/>
            </Grid>

I started my app without debugging with visual studio and... It work 100% correct. 我启动了我的应用程序,没有使用visual studio进行调试......它正常工作100%。 So the problem was in debugging 所以问题出在调试上

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当有硬件键盘时,有没有办法在 UWP 应用程序中显示触摸屏键盘 - Windows 10 - Is there a way to show Touch Screen Keyboard in UWP app when there is a Hardware Keyboard- Windows 10 Windows 10 UWP App-主屏幕未刷新,我正在使用模板10 - Windows 10 UWP App - Main screen does not refresh, I'm using Template 10 Windows 10 UWP中的扩展初始屏幕? - Extended splash screen in Windows 10 UWP? 是否可以防止Windows 10 uwp中的锁定屏幕? - Is it possible to prevent lock screen in Windows 10 uwp? 触摸两个屏幕元素Windows 10通用 - touch two screen elements windows 10 universal 如何在Windows 10 UWP中为网格添加触摸操作事件? - How to add touch manipulation events for a Grid in Windows 10 UWP? UWP-PointerEntered / PointerExited在网格行上模拟鼠标悬停 - UWP - PointerEntered/PointerExited to simulate mousehover on grid rows 日历选择器锁定在屏幕上的Windows 10移动版(UWP)飞出 - Windows 10 mobile (UWP) Flyout with calendar picker locking on screen 停止屏幕截图,包括 Windows 10 的 UWP 应用上的弹出窗口 - Stop screen capture including popup on UWP app of Windows 10 Windows 10 UWP 应用程序在启动画面后立即关闭/崩溃 - Windows 10 UWP app closes/crashes immediately after splash screen
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM