2020-04-08 01:19:14 +08:00
|
|
|
|
// Copyright (c) Microsoft Corporation
|
|
|
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
|
|
|
// See the LICENSE file in the project root for more information.
|
2020-03-31 20:32:22 +08:00
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
using System.Windows.Input;
|
2020-03-31 20:32:22 +08:00
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Helpers;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Lib;
|
|
|
|
|
using Microsoft.PowerToys.Settings.UI.ViewModels.Commands;
|
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Views;
|
2020-05-08 02:24:19 +08:00
|
|
|
|
using Microsoft.Toolkit.Uwp.Helpers;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
using Windows.UI;
|
|
|
|
|
using Windows.UI.Popups;
|
2020-03-31 20:32:22 +08:00
|
|
|
|
|
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|
|
|
|
{
|
|
|
|
|
public class FancyZonesViewModel : Observable
|
|
|
|
|
{
|
2020-04-17 02:45:27 +08:00
|
|
|
|
private const string ModuleName = "FancyZones";
|
|
|
|
|
|
|
|
|
|
public ButtonClickCommand LaunchEditorEventHandler { get; set; }
|
|
|
|
|
|
|
|
|
|
private FancyZonesSettings Settings { get; set; }
|
|
|
|
|
|
2020-03-31 20:32:22 +08:00
|
|
|
|
public FancyZonesViewModel()
|
|
|
|
|
{
|
2020-04-18 06:25:08 +08:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Settings = SettingsUtils.GetSettings<FancyZonesSettings>(ModuleName);
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
Settings = new FancyZonesSettings();
|
|
|
|
|
SettingsUtils.SaveSettings(Settings.ToJsonString(), ModuleName);
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
|
this.LaunchEditorEventHandler = new ButtonClickCommand(LaunchEditor);
|
|
|
|
|
|
|
|
|
|
this._shiftDrag = Settings.Properties.FancyzonesShiftDrag.Value;
|
2020-05-08 04:29:02 +08:00
|
|
|
|
this._mouseSwitch = Settings.Properties.FancyzonesMouseSwitch.Value;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
this._overrideSnapHotkeys = Settings.Properties.FancyzonesOverrideSnapHotkeys.Value;
|
2020-05-08 04:29:02 +08:00
|
|
|
|
this._moveWindowsAcrossMonitors = Settings.Properties.FancyzonesMoveWindowsAcrossMonitors.Value;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
this._displayChangemoveWindows = Settings.Properties.FancyzonesDisplayChangeMoveWindows.Value;
|
|
|
|
|
this._zoneSetChangeMoveWindows = Settings.Properties.FancyzonesZoneSetChangeMoveWindows.Value;
|
|
|
|
|
this._appLastZoneMoveWindows = Settings.Properties.FancyzonesAppLastZoneMoveWindows.Value;
|
2020-07-08 16:37:42 +08:00
|
|
|
|
this._openWindowOnActiveMonitor = Settings.Properties.FancyzonesOpenWindowOnActiveMonitor.Value;
|
2020-07-01 21:36:05 +08:00
|
|
|
|
this._restoreSize = Settings.Properties.FancyzonesRestoreSize.Value;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
this._useCursorPosEditorStartupScreen = Settings.Properties.UseCursorposEditorStartupscreen.Value;
|
|
|
|
|
this._showOnAllMonitors = Settings.Properties.FancyzonesShowOnAllMonitors.Value;
|
2020-05-08 04:29:02 +08:00
|
|
|
|
this._makeDraggedWindowTransparent = Settings.Properties.FancyzonesMakeDraggedWindowTransparent.Value;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
this._highlightOpacity = Settings.Properties.FancyzonesHighlightOpacity.Value;
|
|
|
|
|
this._excludedApps = Settings.Properties.FancyzonesExcludedApps.Value;
|
2020-06-05 05:52:04 +08:00
|
|
|
|
this.EditorHotkey = Settings.Properties.FancyzonesEditorHotkey.Value;
|
2020-05-08 02:24:19 +08:00
|
|
|
|
|
|
|
|
|
string inactiveColor = Settings.Properties.FancyzonesInActiveColor.Value;
|
|
|
|
|
this._zoneInActiveColor = inactiveColor != string.Empty ? inactiveColor.ToColor() : "#F5FCFF".ToColor();
|
|
|
|
|
|
|
|
|
|
string borderColor = Settings.Properties.FancyzonesBorderColor.Value;
|
2020-06-05 05:52:04 +08:00
|
|
|
|
this._zoneBorderColor = borderColor != string.Empty ? borderColor.ToColor() : "#FFFFFF".ToColor();
|
2020-05-08 02:24:19 +08:00
|
|
|
|
|
|
|
|
|
string highlightColor = Settings.Properties.FancyzonesZoneHighlightColor.Value;
|
|
|
|
|
this._zoneHighlightColor = highlightColor != string.Empty ? highlightColor.ToColor() : "#0078D7".ToColor();
|
2020-04-18 06:25:08 +08:00
|
|
|
|
|
|
|
|
|
GeneralSettings generalSettings;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
generalSettings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
generalSettings = new GeneralSettings();
|
|
|
|
|
SettingsUtils.SaveSettings(generalSettings.ToJsonString(), string.Empty);
|
|
|
|
|
}
|
2020-04-17 02:45:27 +08:00
|
|
|
|
|
|
|
|
|
this._isEnabled = generalSettings.Enabled.FancyZones;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool _isEnabled;
|
|
|
|
|
private bool _shiftDrag;
|
2020-05-08 04:29:02 +08:00
|
|
|
|
private bool _mouseSwitch;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
private bool _overrideSnapHotkeys;
|
2020-05-08 04:29:02 +08:00
|
|
|
|
private bool _moveWindowsAcrossMonitors;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
private bool _displayChangemoveWindows;
|
|
|
|
|
private bool _zoneSetChangeMoveWindows;
|
|
|
|
|
private bool _appLastZoneMoveWindows;
|
2020-07-08 16:37:42 +08:00
|
|
|
|
private bool _openWindowOnActiveMonitor;
|
2020-07-01 21:36:05 +08:00
|
|
|
|
private bool _restoreSize;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
private bool _useCursorPosEditorStartupScreen;
|
|
|
|
|
private bool _showOnAllMonitors;
|
2020-05-08 04:29:02 +08:00
|
|
|
|
private bool _makeDraggedWindowTransparent;
|
2020-05-08 02:24:19 +08:00
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
|
private int _highlightOpacity;
|
|
|
|
|
private string _excludedApps;
|
|
|
|
|
private HotkeySettings _editorHotkey;
|
2020-05-08 02:24:19 +08:00
|
|
|
|
private Color _zoneInActiveColor;
|
|
|
|
|
private Color _zoneBorderColor;
|
|
|
|
|
private Color _zoneHighlightColor;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
|
|
|
|
|
public bool IsEnabled
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _isEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _isEnabled)
|
|
|
|
|
{
|
|
|
|
|
_isEnabled = value;
|
|
|
|
|
GeneralSettings generalSettings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
|
|
|
|
generalSettings.Enabled.FancyZones = value;
|
|
|
|
|
OutGoingGeneralSettings snd = new OutGoingGeneralSettings(generalSettings);
|
|
|
|
|
|
|
|
|
|
ShellPage.DefaultSndMSGCallback(snd.ToString());
|
2020-05-08 23:22:57 +08:00
|
|
|
|
OnPropertyChanged("IsEnabled");
|
2020-04-17 02:45:27 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool ShiftDrag
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _shiftDrag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _shiftDrag)
|
|
|
|
|
{
|
|
|
|
|
_shiftDrag = value;
|
|
|
|
|
Settings.Properties.FancyzonesShiftDrag.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 04:29:02 +08:00
|
|
|
|
public bool MouseSwitch
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _mouseSwitch;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _mouseSwitch)
|
|
|
|
|
{
|
|
|
|
|
_mouseSwitch = value;
|
|
|
|
|
Settings.Properties.FancyzonesMouseSwitch.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
|
public bool OverrideSnapHotkeys
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _overrideSnapHotkeys;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _overrideSnapHotkeys)
|
|
|
|
|
{
|
|
|
|
|
_overrideSnapHotkeys = value;
|
|
|
|
|
Settings.Properties.FancyzonesOverrideSnapHotkeys.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 04:29:02 +08:00
|
|
|
|
public bool MoveWindowsAcrossMonitors
|
2020-04-17 02:45:27 +08:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2020-05-08 04:29:02 +08:00
|
|
|
|
return _moveWindowsAcrossMonitors;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2020-05-08 04:29:02 +08:00
|
|
|
|
if (value != _moveWindowsAcrossMonitors)
|
2020-04-17 02:45:27 +08:00
|
|
|
|
{
|
2020-05-08 04:29:02 +08:00
|
|
|
|
_moveWindowsAcrossMonitors = value;
|
|
|
|
|
Settings.Properties.FancyzonesMoveWindowsAcrossMonitors.Value = value;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool DisplayChangeMoveWindows
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _displayChangemoveWindows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _displayChangemoveWindows)
|
|
|
|
|
{
|
|
|
|
|
_displayChangemoveWindows = value;
|
|
|
|
|
Settings.Properties.FancyzonesDisplayChangeMoveWindows.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool ZoneSetChangeMoveWindows
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _zoneSetChangeMoveWindows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _zoneSetChangeMoveWindows)
|
|
|
|
|
{
|
|
|
|
|
_zoneSetChangeMoveWindows = value;
|
|
|
|
|
Settings.Properties.FancyzonesZoneSetChangeMoveWindows.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool AppLastZoneMoveWindows
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _appLastZoneMoveWindows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _appLastZoneMoveWindows)
|
|
|
|
|
{
|
|
|
|
|
_appLastZoneMoveWindows = value;
|
|
|
|
|
Settings.Properties.FancyzonesAppLastZoneMoveWindows.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-08 16:37:42 +08:00
|
|
|
|
public bool OpenWindowOnActiveMonitor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _openWindowOnActiveMonitor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _openWindowOnActiveMonitor)
|
|
|
|
|
{
|
|
|
|
|
_openWindowOnActiveMonitor = value;
|
|
|
|
|
Settings.Properties.FancyzonesOpenWindowOnActiveMonitor.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-01 21:36:05 +08:00
|
|
|
|
public bool RestoreSize
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _restoreSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _restoreSize)
|
|
|
|
|
{
|
|
|
|
|
_restoreSize = value;
|
|
|
|
|
Settings.Properties.FancyzonesRestoreSize.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
|
public bool UseCursorPosEditorStartupScreen
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _useCursorPosEditorStartupScreen;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _useCursorPosEditorStartupScreen)
|
|
|
|
|
{
|
|
|
|
|
_useCursorPosEditorStartupScreen = value;
|
|
|
|
|
Settings.Properties.UseCursorposEditorStartupscreen.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool ShowOnAllMonitors
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _showOnAllMonitors;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _showOnAllMonitors)
|
|
|
|
|
{
|
|
|
|
|
_showOnAllMonitors = value;
|
|
|
|
|
Settings.Properties.FancyzonesShowOnAllMonitors.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 04:29:02 +08:00
|
|
|
|
public bool MakeDraggedWindowsTransparent
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _makeDraggedWindowTransparent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _makeDraggedWindowTransparent)
|
|
|
|
|
{
|
|
|
|
|
_makeDraggedWindowTransparent = value;
|
|
|
|
|
Settings.Properties.FancyzonesMakeDraggedWindowTransparent.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 02:24:19 +08:00
|
|
|
|
public Color ZoneHighlightColor
|
2020-04-17 02:45:27 +08:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _zoneHighlightColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _zoneHighlightColor)
|
|
|
|
|
{
|
|
|
|
|
_zoneHighlightColor = value;
|
2020-05-08 02:24:19 +08:00
|
|
|
|
Settings.Properties.FancyzonesZoneHighlightColor.Value = ToRGBHex(value);
|
2020-04-17 02:45:27 +08:00
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 02:24:19 +08:00
|
|
|
|
public Color ZoneBorderColor
|
2020-04-18 06:25:08 +08:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _zoneBorderColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _zoneBorderColor)
|
|
|
|
|
{
|
|
|
|
|
_zoneBorderColor = value;
|
2020-05-08 02:24:19 +08:00
|
|
|
|
Settings.Properties.FancyzonesBorderColor.Value = ToRGBHex(value);
|
2020-04-18 06:25:08 +08:00
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 02:24:19 +08:00
|
|
|
|
public Color ZoneInActiveColor
|
2020-04-18 06:25:08 +08:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _zoneInActiveColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _zoneInActiveColor)
|
|
|
|
|
{
|
|
|
|
|
_zoneInActiveColor = value;
|
2020-05-08 02:24:19 +08:00
|
|
|
|
Settings.Properties.FancyzonesInActiveColor.Value = ToRGBHex(value);
|
2020-04-18 06:25:08 +08:00
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
|
public int HighlightOpacity
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _highlightOpacity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _highlightOpacity)
|
|
|
|
|
{
|
|
|
|
|
_highlightOpacity = value;
|
|
|
|
|
Settings.Properties.FancyzonesHighlightOpacity.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HotkeySettings EditorHotkey
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _editorHotkey;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _editorHotkey)
|
|
|
|
|
{
|
2020-06-05 05:52:04 +08:00
|
|
|
|
if (value.IsEmpty())
|
|
|
|
|
{
|
2020-07-24 06:53:12 +08:00
|
|
|
|
|
|
|
|
|
_editorHotkey = FZConfigProperties.DefaultHotkeyValue;
|
2020-06-05 05:52:04 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_editorHotkey = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Settings.Properties.FancyzonesEditorHotkey.Value = _editorHotkey;
|
2020-04-17 02:45:27 +08:00
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string ExcludedApps
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _excludedApps;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _excludedApps)
|
|
|
|
|
{
|
|
|
|
|
_excludedApps = value;
|
|
|
|
|
Settings.Properties.FancyzonesExcludedApps.Value = value;
|
|
|
|
|
RaisePropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LaunchEditor()
|
|
|
|
|
{
|
|
|
|
|
// send message to launch the zones editor;
|
|
|
|
|
ShellPage.DefaultSndMSGCallback("{\"action\":{\"FancyZones\":{\"action_name\":\"ToggledFZEditor\", \"value\":\"\"}}}");
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 02:24:19 +08:00
|
|
|
|
private String ToRGBHex(Color color)
|
2020-04-18 06:25:08 +08:00
|
|
|
|
{
|
2020-05-08 02:24:19 +08:00
|
|
|
|
return "#" + color.R.ToString("X2") + color.G.ToString("X2") + color.B.ToString("X2");
|
2020-04-18 06:25:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
|
public void RaisePropertyChanged([CallerMemberName] string propertyName = null)
|
|
|
|
|
{
|
|
|
|
|
OnPropertyChanged(propertyName);
|
2020-07-08 23:00:44 +08:00
|
|
|
|
if (ShellPage.DefaultSndMSGCallback != null)
|
|
|
|
|
{
|
|
|
|
|
SndFancyZonesSettings outsettings = new SndFancyZonesSettings(Settings);
|
|
|
|
|
SndModuleSettings<SndFancyZonesSettings> ipcMessage = new SndModuleSettings<SndFancyZonesSettings>(outsettings);
|
|
|
|
|
ShellPage.DefaultSndMSGCallback(ipcMessage.ToJsonString());
|
|
|
|
|
}
|
2020-03-31 20:32:22 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-04-11 06:22:07 +08:00
|
|
|
|
}
|