feat(ModEvent): 支持一个按钮执行多个事件

没给 HelpEntry 加这个功能,其他控件都加了
This commit is contained in:
Open-KFC
2025-04-07 07:01:54 +08:00
parent 16e09c792c
commit cd736be212
9 changed files with 298 additions and 125 deletions
+13 -1
View File
@@ -79,7 +79,7 @@ Public Class MyHint
IsMouseDown = False
Log("[Control] 按下提示条" & If(String.IsNullOrEmpty(Name), "", ":" & Name))
e.Handled = True
ModEvent.TryStartEvent(EventType, EventData)
ModEvent.ProcessCustomEvents(EventType, EventData, _CustomEvents)
End Sub
Private Sub MyHint_MouseDown(sender As Object, e As MouseButtonEventArgs) Handles Me.MouseLeftButtonDown
IsMouseDown = True
@@ -105,6 +105,18 @@ Public Class MyHint
End Set
End Property
Public Shared ReadOnly EventDataProperty As DependencyProperty = DependencyProperty.Register("EventData", GetType(String), GetType(MyHint), New PropertyMetadata(Nothing))
Public Property CustomEvents As CustomEventCollection
Get
If _CustomEvents Is Nothing Then
_CustomEvents = New CustomEventCollection
End If
Return _CustomEvents
End Get
Set(value As CustomEventCollection)
_CustomEvents = value
End Set
End Property
Private _CustomEvents As CustomEventCollection = Nothing
End Class
Partial Public Module ModAnimation