feat: unify layer update code.

This commit is contained in:
rabbitism
2024-01-24 11:32:07 +08:00
parent 564a53409e
commit a174f0cd85
2 changed files with 43 additions and 32 deletions

View File

@@ -127,23 +127,11 @@ public class DialogControl: ContentControl
}
}
public void BringForward()
public void UpdateLayer(object? o)
{
OnLayerChange?.Invoke(this, new DialogLayerChangeEventArgs(DialogLayerChangeType.BringForward));
}
public void SendBackward()
{
OnLayerChange?.Invoke(this, new DialogLayerChangeEventArgs(DialogLayerChangeType.SendBackward));
}
public void BringToFront()
{
OnLayerChange?.Invoke(this, new DialogLayerChangeEventArgs(DialogLayerChangeType.BringToFront));
}
public void SendToBack()
{
OnLayerChange?.Invoke(this, new DialogLayerChangeEventArgs(DialogLayerChangeType.SendToBack));
if (o is DialogLayerChangeType t)
{
OnLayerChange?.Invoke(this, new DialogLayerChangeEventArgs(t));
}
}
}