Dreamine.UI.Wpf
1.0.1
Dreamine.UI.Wpf 사용자 인터페이스 기능과 구성 요소를 제공합니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
WindowDragBehavior.cs
이 파일의 문서화 페이지로 가기
1
using
System.Windows;
2
using
Microsoft.Xaml.Behaviors;
3
4
namespace
Dreamine.UI.Wpf.Behaviors
;
5
14
public
class
WindowDragBehavior
: Behavior<FrameworkElement>
15
{
24
public
bool
IsDragEnabled
{
get
;
set
; } =
true
;
25
34
protected
override
void
OnAttached
()
35
{
36
base.OnAttached();
37
AssociatedObject.MouseLeftButtonDown +=
OnMouseLeftButtonDown
;
38
}
39
48
protected
override
void
OnDetaching
()
49
{
50
AssociatedObject.MouseLeftButtonDown -=
OnMouseLeftButtonDown
;
51
base.OnDetaching();
52
}
53
86
private
void
OnMouseLeftButtonDown
(
object
sender, System.Windows.Input.MouseButtonEventArgs e)
87
{
88
if
(!
IsDragEnabled
)
return
;
89
var window = Window.GetWindow(AssociatedObject);
90
window?.DragMove();
91
}
92
}
Dreamine.UI.Wpf.Behaviors
Definition
AutoScrollListBoxBehavior.cs:5
Dreamine.UI.Wpf.Behaviors.WindowDragBehavior
Definition
WindowDragBehavior.cs:15
Dreamine.UI.Wpf.Behaviors.WindowDragBehavior.IsDragEnabled
bool IsDragEnabled
Definition
WindowDragBehavior.cs:24
Dreamine.UI.Wpf.Behaviors.WindowDragBehavior.OnDetaching
override void OnDetaching()
Definition
WindowDragBehavior.cs:48
Dreamine.UI.Wpf.Behaviors.WindowDragBehavior.OnAttached
override void OnAttached()
Definition
WindowDragBehavior.cs:34
Dreamine.UI.Wpf.Behaviors.WindowDragBehavior.OnMouseLeftButtonDown
void OnMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
Definition
WindowDragBehavior.cs:86
Behaviors
WindowDragBehavior.cs
다음에 의해 생성됨 :
1.17.0