Skip to content

Commit

Permalink
Hide resize grip when window is docked.
Browse files Browse the repository at this point in the history
  • Loading branch information
changbw001 committed Dec 30, 2016
1 parent 4600595 commit 88197d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ public DockStatus DockedTo
}

public static readonly DependencyProperty DockedToProperty =
DependencyProperty.Register("DockedTo", typeof(DockStatus), typeof(MainWindow), new PropertyMetadata(DockStatus.None));
DependencyProperty.Register("DockedTo", typeof(DockStatus), typeof(MainWindow), new PropertyMetadata(DockStatus.None, new PropertyChangedCallback(OnDockedToChanged)));

private static void OnDockedToChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ds = (DockStatus)e.NewValue;
if (ds == DockStatus.None) ((Window)d).ResizeMode = ResizeMode.CanResizeWithGrip;
else ((Window)d).ResizeMode = ResizeMode.NoResize;
}

internal void DockToSide(bool changpos = false)
{
Expand Down
Binary file modified bin/Release/DesktopNote.exe
Binary file not shown.

0 comments on commit 88197d9

Please sign in to comment.