Hi,
I continue to struggle with my UWP framework...
I can drag XAML-things around with my mousepointer.
I can also add KeyDown events to the Page, and these work fine.
However, whenever I have clicked somewhere with the mouse, the KeyDown event doesn't fire anymore (I can see that it's not even reached, when trying with breakpoints).
And so, it seems like the mouseclick is taking over focus somehow. Is there a way to kill the mouseclick event or similar?
I wrote the code below, but it doesn't do any good.
public MainPage()
{
this.KeyDown += Page_KeyDown;
this.InitializeComponent();
Here is also the beginning of my XAML code:
<Page
x:Class="Spritehand.PhysicsHelper.Demos.UWP.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Spritehand.PhysicsHelper.Demos.UWP"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ph="using:Spritehand.FarseerHelper"
mc:Ignorable="d" KeyDown="Page_KeyDown">
<Grid x:Name="LayoutRoot" removed="CornflowerBlue">
<Canvas x:Name="cnvGameOuter" >
<ph:PhysicsCanvas x:Name="cnvGame" removed="Green" GravityHorizontal="0" GravityVertical="0" DebugMode="False" Width="1366" Height="768" MousePickEnabled="true">
<local:ucBlock Canvas.Left="150" Canvas.Top="10" />
What I have tried:
I have tried to trace the fault using breakpoints and I have come up with the error described above.