Fixed files: - SkiaImageButton.cs: Added SVG support with multi-path search - SkiaNavigationPage.cs: Added LinuxApplication.IsGtkMode check - SkiaRefreshView.cs: Added ICommand support (Command, CommandParameter) - SkiaTemplatedView.cs: Added missing using statements Extracted embedded types to separate files (matching decompiled pattern): - From SkiaMenuBar.cs: MenuBarItem, MenuItem, SkiaMenuFlyout, MenuItemClickedEventArgs - From SkiaNavigationPage.cs: NavigationEventArgs - From SkiaTabbedPage.cs: TabItem - From SkiaVisualStateManager.cs: SkiaVisualStateGroupList, SkiaVisualStateGroup, SkiaVisualState, SkiaVisualStateSetter - From SkiaSwipeView.cs: SwipeItem, SwipeStartedEventArgs, SwipeEndedEventArgs - From SkiaFlyoutPage.cs: FlyoutLayoutBehavior (already separate) - From SkiaIndicatorView.cs: IndicatorShape (already separate) - From SkiaBorder.cs: SkiaFrame - From SkiaCarouselView.cs: PositionChangedEventArgs - From SkiaCollectionView.cs: SkiaSelectionMode, ItemsLayoutOrientation - From SkiaContentPresenter.cs: LayoutAlignment Verified matching decompiled: - SkiaContextMenu.cs, SkiaFlexLayout.cs, SkiaGraphicsView.cs Build: 0 errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
48 lines
1.0 KiB
C#
48 lines
1.0 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
|
|
using Microsoft.Maui.Animations;
|
|
|
|
namespace Microsoft.Maui.Platform.Linux.Hosting;
|
|
|
|
internal class LinuxTicker : ITicker
|
|
{
|
|
private Timer? _timer;
|
|
private bool _isRunning;
|
|
private int _maxFps = 60;
|
|
|
|
public bool IsRunning => _isRunning;
|
|
|
|
public bool SystemEnabled => true;
|
|
|
|
public int MaxFps
|
|
{
|
|
get => _maxFps;
|
|
set => _maxFps = Math.Max(1, Math.Min(120, value));
|
|
}
|
|
|
|
public Action? Fire { get; set; }
|
|
|
|
public void Start()
|
|
{
|
|
if (!_isRunning)
|
|
{
|
|
_isRunning = true;
|
|
var period = TimeSpan.FromMilliseconds(1000.0 / _maxFps);
|
|
_timer = new Timer(OnTimerCallback, null, TimeSpan.Zero, period);
|
|
}
|
|
}
|
|
|
|
public void Stop()
|
|
{
|
|
_isRunning = false;
|
|
_timer?.Dispose();
|
|
_timer = null;
|
|
}
|
|
|
|
private void OnTimerCallback(object? state)
|
|
{
|
|
Fire?.Invoke();
|
|
}
|
|
}
|