Files
maui-linux/Views/SkiaVisualStateSetter.cs
Dave Friedel 1f096c38dc Update with recovered code from VM binaries (Jan 1)
Recovered from decompiled OpenMaui.Controls.Linux.dll:
- SkiaShell.cs: FlyoutHeader, FlyoutFooter, scroll support (918 -> 1325 lines)
- X11Window.cs: Cursor support (XCreateFontCursor, XDefineCursor)
- All handlers with dark mode support
- All services with latest implementations
- LinuxApplication with theme change handling
2026-01-01 06:22:48 -05:00

36 lines
676 B
C#

using Microsoft.Maui.Controls;
namespace Microsoft.Maui.Platform;
public class SkiaVisualStateSetter
{
private object? _originalValue;
private bool _hasOriginalValue;
public BindableProperty? Property { get; set; }
public object? Value { get; set; }
public void Apply(SkiaView view)
{
if (Property != null)
{
if (!_hasOriginalValue)
{
_originalValue = ((BindableObject)view).GetValue(Property);
_hasOriginalValue = true;
}
((BindableObject)view).SetValue(Property, Value);
}
}
public void Unapply(SkiaView view)
{
if (Property != null && _hasOriginalValue)
{
((BindableObject)view).SetValue(Property, _originalValue);
}
}
}