Respect isDraggable by toggling WindowChrome caption drag
This commit is contained in:
@@ -67,6 +67,7 @@ namespace C4IT_CustomerPanel
|
||||
private DispatcherTimer _adHocTimer;
|
||||
private DispatcherTimer _regularTimer;
|
||||
private DispatcherTimer _checkServerConnectionTimer;
|
||||
private const double HeaderCaptionHeight = 72d;
|
||||
private bool _initialTimerInvocationDone = false;
|
||||
private bool _manualRefreshInProgress = false;
|
||||
private TimeSpan _lastTicketInterval;
|
||||
@@ -506,10 +507,7 @@ namespace C4IT_CustomerPanel
|
||||
|
||||
private void SetAppearance(bool firstStart)
|
||||
{
|
||||
if (!ConfigSettings.GetConfig()._isDraggable)
|
||||
{
|
||||
ResetLocation();
|
||||
}
|
||||
ApplyWindowDraggableState();
|
||||
|
||||
System.Collections.ObjectModel.Collection<ResourceDictionary> themes = new System.Collections.ObjectModel.Collection<ResourceDictionary>();
|
||||
if (ConfigSettings.GetConfig()._iconColor != 0)
|
||||
@@ -559,6 +557,18 @@ namespace C4IT_CustomerPanel
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyWindowDraggableState()
|
||||
{
|
||||
bool draggable = ConfigSettings?.GetConfig()?._isDraggable ?? true;
|
||||
|
||||
if (!draggable)
|
||||
ResetLocation();
|
||||
|
||||
WindowChrome chrome = WindowChrome.GetWindowChrome(this);
|
||||
if (chrome != null)
|
||||
chrome.CaptionHeight = draggable ? HeaderCaptionHeight : 0d;
|
||||
}
|
||||
|
||||
public void ResetLocation()
|
||||
{
|
||||
var CM = MethodBase.GetCurrentMethod();
|
||||
|
||||
Reference in New Issue
Block a user