|
|
|
@ -15,6 +15,8 @@ class CompositionBorderVisual : CompositionDrawListVisual |
|
|
|
private bool _cornerRadiusChanged; |
|
|
|
private Thickness _borderThickness; |
|
|
|
private bool _borderThicknessChanged; |
|
|
|
private BackgroundSizing _backgroundSizing; |
|
|
|
private bool _backgroundSizingChanged; |
|
|
|
|
|
|
|
public CompositionBorderVisual(Compositor compositor, Visual visual) : base(compositor, |
|
|
|
new ServerBorderVisual(compositor.Server, visual), visual) |
|
|
|
@ -49,6 +51,20 @@ class CompositionBorderVisual : CompositionDrawListVisual |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public BackgroundSizing BackgroundSizing |
|
|
|
{ |
|
|
|
get => _backgroundSizing; |
|
|
|
set |
|
|
|
{ |
|
|
|
if (_backgroundSizing != value) |
|
|
|
{ |
|
|
|
_backgroundSizingChanged = true; |
|
|
|
_backgroundSizing = value; |
|
|
|
RegisterForSerialization(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private protected override void SerializeChangesCore(BatchStreamWriter writer) |
|
|
|
{ |
|
|
|
base.SerializeChangesCore(writer); |
|
|
|
@ -58,12 +74,16 @@ class CompositionBorderVisual : CompositionDrawListVisual |
|
|
|
writer.Write(_borderThicknessChanged); |
|
|
|
if (_borderThicknessChanged) |
|
|
|
writer.Write(_borderThickness); |
|
|
|
writer.Write(_backgroundSizingChanged); |
|
|
|
if (_backgroundSizingChanged) |
|
|
|
writer.Write(_backgroundSizing); |
|
|
|
} |
|
|
|
|
|
|
|
class ServerBorderVisual : ServerCompositionDrawListVisual |
|
|
|
{ |
|
|
|
private CornerRadius _cornerRadius; |
|
|
|
private Thickness _borderThickness; |
|
|
|
private BackgroundSizing _backgroundSizing; |
|
|
|
public ServerBorderVisual(ServerCompositor compositor, Visual v) : base(compositor, v) |
|
|
|
{ |
|
|
|
} |
|
|
|
@ -79,6 +99,8 @@ class CompositionBorderVisual : CompositionDrawListVisual |
|
|
|
_cornerRadius = reader.Read<CornerRadius>(); |
|
|
|
if (reader.Read<bool>()) |
|
|
|
_borderThickness = reader.Read<Thickness>(); |
|
|
|
if (reader.Read<bool>()) |
|
|
|
_backgroundSizing = reader.Read<BackgroundSizing>(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|