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
36 lines
676 B
C#
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);
|
|
}
|
|
}
|
|
}
|