我在我的解决方案中使用Inkcanvas。所以我想在用户确认后删除,像这样......
XAML:
<InkCanvas Grid.RowSpan="3" Name="ink" StrokeErasing="ink_StrokeErasing" />
C#:
private void ink_StrokeErasing(object sender, InkCanvasStrokeErasingEventArgs e)
{
if (MessageBox.Show("Delete this stroke?", "", MessageBoxButton.OKCancel) != MessageBoxResult.OK)
{
e.Cancel = true;
}
}
之后,我可以看到消息框两次,:( 这不知道这是怎么发生的。请让我知道这一点。