Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions MahApps.Metro/Controls/MetroWindow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -83,6 +83,7 @@ public class MetroWindow : Window
public static readonly DependencyProperty OverrideDefaultWindowCommandsBrushProperty = DependencyProperty.Register("OverrideDefaultWindowCommandsBrush", typeof(SolidColorBrush), typeof(MetroWindow));

public static readonly DependencyProperty EnableDWMDropShadowProperty = DependencyProperty.Register("EnableDWMDropShadow", typeof(bool), typeof(MetroWindow), new PropertyMetadata(false));
public static readonly DependencyProperty IsWindowDraggableProperty = DependencyProperty.Register("IsWindowDraggable", typeof(bool), typeof(MetroWindow), new PropertyMetadata(true));

UIElement icon;
UIElement titleBar;
Expand Down Expand Up @@ -127,6 +128,12 @@ public bool EnableDWMDropShadow
set { SetValue(EnableDWMDropShadowProperty, value); }
}

public bool IsWindowDraggable
{
get { return (bool)GetValue(IsWindowDraggableProperty); }
set { SetValue(IsWindowDraggableProperty, value); }
}

public WindowCommandsOverlayBehavior LeftWindowCommandsOverlayBehavior
{
get { return (WindowCommandsOverlayBehavior)this.GetValue(LeftWindowCommandsOverlayBehaviorProperty); }
Expand Down Expand Up @@ -812,7 +819,7 @@ private void SetWindowEvents()
else
{
// handle mouse events for windows without PART_WindowTitleBackground or PART_TitleBar
MouseDown += TitleBarMouseDown;
if (IsWindowDraggable) MouseDown += TitleBarMouseDown; //Don't move the window if WindowDragMove is false
MouseUp += TitleBarMouseUp;
}
}
Expand Down