using System;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;namespace wpfcore
{public partial class MainWindow : Window{public MainWindow(){InitializeComponent();DataContext = this;}private void mouseUp(object sender, MouseButtonEventArgs e){var p = e.GetPosition(sender as UIElement);VisualTreeHelper.HitTest(panel, null, callback, new PointHitTestParameters(p));System.Diagnostics.Debug.WriteLine($"------------------------");}private HitTestResultBehavior callback(HitTestResult result){System.Diagnostics.Debug.WriteLine($"點(diǎn)擊了{(lán)result.VisualHit.GetValue(NameProperty)}");return HitTestResultBehavior.Continue;}}
}