Canvas PointerPressed event GetCurrentPoint throws exception [SOLVED]
Posted: Sat Oct 31, 2015 2:38 am
I have a Canvas control (CnvGrid). I then capture the PointerPressed event of the Canvas control. When I click on the canvas the PointerPressed event is raised. However I get the error:
An unhandled exception of type 'System.NullReferenceException' occurred in CSharpXamlForHtml5.dll
Object reference not set to an instance of an object.
Below is the code:
If I replace CnvGrid with this so line becomes e.GetCurentPoint(this) same problem.
Is this a bug?
Gavin
An unhandled exception of type 'System.NullReferenceException' occurred in CSharpXamlForHtml5.dll
Object reference not set to an instance of an object.
Below is the code:
Code: Select all
private void CnvGrid_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
var pos = e.GetCurrentPoint(CnvGrid);
}
If I replace CnvGrid with this so line becomes e.GetCurentPoint(this) same problem.
Is this a bug?
Gavin