Родитель
baf4a30199
Коммит
c7bb53cd82
|
@ -44,7 +44,10 @@ namespace Xamarin.Forms.Platform.WPF
|
|||
Style = (System.Windows.Style)System.Windows.Application.Current.Resources["ListViewTemplate"]
|
||||
};
|
||||
SetNativeControl(listView);
|
||||
Control.SelectionChanged += OnNativeSelectionChanged;
|
||||
Control.MouseUp += OnNativeMouseUp;
|
||||
Control.KeyUp += OnNativeKeyUp;
|
||||
Control.TouchUp += OnNativeTouchUp;
|
||||
Control.StylusUp += OnNativeStylusUp;
|
||||
}
|
||||
|
||||
// Update control property
|
||||
|
@ -122,12 +125,17 @@ namespace Xamarin.Forms.Platform.WPF
|
|||
}
|
||||
}
|
||||
|
||||
void OnNativeKeyUp(object sender, KeyEventArgs e)
|
||||
=> Element.NotifyRowTapped(Control.SelectedIndex, cell: null);
|
||||
|
||||
|
||||
void OnNativeSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
Element.NotifyRowTapped(Control.SelectedIndex, cell:null);
|
||||
}
|
||||
void OnNativeMouseUp(object sender, MouseButtonEventArgs e)
|
||||
=> Element.NotifyRowTapped(Control.SelectedIndex, cell: null);
|
||||
|
||||
void OnNativeTouchUp(object sender, TouchEventArgs e)
|
||||
=> Element.NotifyRowTapped(Control.SelectedIndex, cell: null);
|
||||
|
||||
void OnNativeStylusUp(object sender, StylusEventArgs e)
|
||||
=> Element.NotifyRowTapped(Control.SelectedIndex, cell: null);
|
||||
|
||||
bool _isDisposed;
|
||||
|
||||
|
@ -140,7 +148,10 @@ namespace Xamarin.Forms.Platform.WPF
|
|||
{
|
||||
if (Control != null)
|
||||
{
|
||||
Control.SelectionChanged -= OnNativeSelectionChanged;
|
||||
Control.MouseUp -= OnNativeMouseUp;
|
||||
Control.KeyUp -= OnNativeKeyUp;
|
||||
Control.TouchUp -= OnNativeTouchUp;
|
||||
Control.StylusUp -= OnNativeStylusUp;
|
||||
}
|
||||
|
||||
if (Element != null)
|
||||
|
|
Загрузка…
Ссылка в новой задаче