mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Settings][ColorPicker]Fix issues related to custom color formats (#22493)
* ColorPicker fixing problem settings not sent to CP module (when newly created formats change) * ColorPicker fixing problem Move Up button diabled for the 2nd element of the color formats list after creating a new color format.
This commit is contained in:
@@ -86,8 +86,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
|||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_canMoveUp = value;
|
if (value != _canMoveUp)
|
||||||
OnPropertyChanged(nameof(CanMoveUp));
|
{
|
||||||
|
_canMoveUp = value;
|
||||||
|
OnPropertyChanged(nameof(CanMoveUp));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,8 +103,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
|||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_canMoveDown = value;
|
if (value != _canMoveDown)
|
||||||
OnPropertyChanged(nameof(CanMoveDown));
|
{
|
||||||
|
_canMoveDown = value;
|
||||||
|
OnPropertyChanged(nameof(CanMoveDown));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -336,7 +336,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
ColorFormats[0].CanMoveUp = true;
|
ColorFormats[0].CanMoveUp = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorFormats.Insert(0, new ColorFormatModel(newColorName, newColorFormat, isShown));
|
ColorFormatModel newModel = new ColorFormatModel(newColorName, newColorFormat, isShown);
|
||||||
|
newModel.PropertyChanged += ColorFormat_PropertyChanged;
|
||||||
|
ColorFormats.Insert(0, newModel);
|
||||||
SetPreviewSelectedIndex();
|
SetPreviewSelectedIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@
|
|||||||
<MenuFlyoutItem
|
<MenuFlyoutItem
|
||||||
x:Uid="MoveUp"
|
x:Uid="MoveUp"
|
||||||
Click="ReorderButtonUp_Click"
|
Click="ReorderButtonUp_Click"
|
||||||
IsEnabled="{x:Bind CanMoveUp}">
|
IsEnabled="{x:Bind CanMoveUp, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
|
||||||
<MenuFlyoutItem.Icon>
|
<MenuFlyoutItem.Icon>
|
||||||
<FontIcon Glyph="" />
|
<FontIcon Glyph="" />
|
||||||
</MenuFlyoutItem.Icon>
|
</MenuFlyoutItem.Icon>
|
||||||
@@ -197,7 +197,7 @@
|
|||||||
<MenuFlyoutItem
|
<MenuFlyoutItem
|
||||||
x:Uid="MoveDown"
|
x:Uid="MoveDown"
|
||||||
Click="ReorderButtonDown_Click"
|
Click="ReorderButtonDown_Click"
|
||||||
IsEnabled="{x:Bind CanMoveDown}">
|
IsEnabled="{x:Bind CanMoveDown, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
|
||||||
<MenuFlyoutItem.Icon>
|
<MenuFlyoutItem.Icon>
|
||||||
<FontIcon Glyph="" />
|
<FontIcon Glyph="" />
|
||||||
</MenuFlyoutItem.Icon>
|
</MenuFlyoutItem.Icon>
|
||||||
|
|||||||
Reference in New Issue
Block a user