更新
This commit is contained in:
32
WPFDark/StandardControls/ExpanderEventHandler.cs
Normal file
32
WPFDark/StandardControls/ExpanderEventHandler.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
using WPFDark.Internals;
|
||||
|
||||
namespace WPFDark.StandardControls
|
||||
{
|
||||
public partial class ExpanderEventHandler
|
||||
{
|
||||
private void OnPreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
|
||||
var e2 = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta)
|
||||
{
|
||||
RoutedEvent = UIElement.MouseWheelEvent
|
||||
};
|
||||
|
||||
(sender as UIElement)?.RaiseEvent(e2);
|
||||
}
|
||||
|
||||
private void Frame_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var c = (StackPanel) sender;
|
||||
var expander = c.GetParent<Expander>();
|
||||
|
||||
if (expander != null)
|
||||
c.Tag = expander.IsExpanded ? 1.0 : 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user