شعار Avalonia Interop Rendering

Avalonia Interop Rendering

المجتمع
linuxdevel
avalonia-interop-rendering

Use when going beyond Render()/DrawingContext in Avalonia — Composition API (ElementComposition, CompositionCustomVisualHandler, implicit/expression animations and animation groups), ICustomDrawOperation with direct SkiaSharp access, OpenGlControlBase, WriteableBitmap/ILockedFramebuffer pixel work, NativeControlHost embedding native HWND/NSView, hosting Avalonia in WinForms/WinUI or EmbeddableControlRoot, text-shaping setup (UseSkia + UseHarfBuzz), or choosing/configuring rendering backends (Skia, Wayland, refresh rate).

نظرة عامة

الناشرlinuxdevel
المستودعAvalonia-skills
اسم المهارةavalonia-interop-rendering
النجوم
50
التفريعات
4
الملفات المرفقة
تعليمات فقط
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها linuxdevel على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Avalonia Interop Rendering في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-interop-rendering
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/linuxdevel/Avalonia-skills.git /tmp/Avalonia-skills
mkdir -p .claude/skills
cp -r /tmp/Avalonia-skills/skills/avalonia/avalonia-interop-rendering .claude/skills/avalonia-interop-rendering
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Avalonia Interop Rendering في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج Avalonia Interop Rendering تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Avalonia Interop Rendering بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تترتب أي تكلفة على المهارة غير المستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Avalonia Advanced Rendering & Native Interop

Basic Render(DrawingContext), brushes, geometry and animations: see avalonia-custom-controls and avalonia-graphics-animation. Version labels: see avalonia-versions. This skill covers what sits below/beside them.

Which Tool?

NeedUse
Draw shapes/text in a controlRender(DrawingContext) (other skills)
Raw SkiaSharp calls (SKCanvas, shaders, SKPath effects)ICustomDrawOperation + ISkiaSharpApiLeaseFeature
Animation/redraw loop on the render thread, independent of UI threadComposition custom visual (CompositionCustomVisualHandler)
Animate offset/opacity/scale of an existing control on the compositorComposition implicit/explicit animations
Own OpenGL sceneOpenGlControlBase
Per-pixel CPU imageWriteableBitmap + Lock()
Real native widget (HWND, NSView, X11 window) inside the treeNativeControlHost
Avalonia inside another UI toolkitWinForms host, EmbeddableControlRoot, Avalonia.WinUI (12.1+)

Composition API

Namespace Avalonia.Rendering.Composition. Compositor objects live on the render thread; UI-thread properties are copied across.

csharp
// Entry point: the element's backing CompositionVisual (null until attached to a root)
var visual = ElementComposition.GetElementVisual(control);
var compositor = visual?.Compositor;

Use it from OnAttachedToVisualTree or later — never the constructor.

Custom visual with its own render-thread loop

csharp
sealed class SpinnerHandler : CompositionCustomVisualHandler
{
    public static readonly object Start = new(), Stop = new();
    bool _running; TimeSpan _last; double _angle;

    public override void OnMessage(object message)          // UI thread -> render thread
    {
        if (message == Start) { _running = true; _last = CompositionNow; RegisterForNextAnimationFrameUpdate(); }
        else if (message == Stop) _running = false;
    }

    public override void OnAnimationFrameUpdate()           // once per frame while registered
    {
        if (!_running) return;
        var now = CompositionNow;
        _angle = (_angle + (now - _last).TotalSeconds * 180) % 360;
        _last = now;
        Invalidate();                                       // or Invalidate(Rect) for precise dirty rects
        RegisterForNextAnimationFrameUpdate();              // must re-register every frame
    }

    public override void OnRender(ImmediateDrawingContext context)
    {
        // Draw from state computed in OnAnimationFrameUpdate (e.g. _angle -> position of a marker)
        var x = EffectiveSize.X / 2 + Math.Cos(_angle * Math.PI / 180) * 30;
        var y = EffectiveSize.Y / 2 + Math.Sin(_angle * Math.PI / 180) * 30;
        context.DrawEllipse(Brushes.DodgerBlue, null, new Point(x, y), 8, 8);   // as in ControlCatalog sample
    }
}

// In the control:
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{
    base.OnAttachedToVisualTree(e);
    var compositor = ElementComposition.GetElementVisual(this)?.Compositor;
    if (compositor is null) return;
    _custom = compositor.CreateCustomVisual(new SpinnerHandler());
    ElementComposition.SetElementChildVisual(this, _custom);
    _custom.Size = new Vector(Bounds.Width, Bounds.Height);   // keep in sync on size change
    _custom.SendHandlerMessage(SpinnerHandler.Start);
}

Handler members (all verified): OnMessage, OnAnimationFrameUpdate, OnRender, GetRenderBounds, EffectiveSize, CompositionNow, Invalidate(), Invalidate(Rect), RegisterForNextAnimationFrameUpdate(), RenderClipContains, RenderClipIntersectes (sic).

Implicit animations (animate when a property changes)

csharp
var compositor = ElementComposition.GetElementVisual(this)!.Compositor;
var offset = compositor.CreateVector3KeyFrameAnimation();
offset.Target = "Offset";
offset.InsertExpressionKeyFrame(1.0f, "this.FinalValue");
offset.Duration = TimeSpan.FromMilliseconds(400);

var implicitAnims = compositor.CreateImplicitAnimationCollection();
implicitAnims["Offset"] = offset;                          // sample wraps animations in CreateAnimationGroup()
ElementComposition.GetElementVisual(childControl)!.ImplicitAnimations = implicitAnims;

Explicit: visual.StartAnimation("Opacity", anim), StopAnimation, StartAnimationGroup. CompositionVisual properties: Offset, Opacity, Scale (Vector3D), RotationAngle, CenterPoint, Size (Vector), Visible, ClipToBounds, OpacityMask, Orientation. (12.0+) Translation (Vector3D) — offset applied on top of layout Offset, ideal for transient motion without fighting layout.

Parameterized expression animation (12.1)

An expression can follow another composition object's properties without a UI-thread update each frame. Both controls must be attached to the same compositor. This helper owns the target's composition opacity until its cleanup action runs; do not start a competing animation or binding on that property.

csharp
using System;
using Avalonia.Controls;
using Avalonia.Rendering.Composition;

static Action FollowOpacity(Control target, Control source)
{
    var visual = ElementComposition.GetElementVisual(target) ?? throw new InvalidOperationException("Attach the target first.");
    var sourceVisual = ElementComposition.GetElementVisual(source) ?? throw new InvalidOperationException("Attach the source first.");
    if (visual == sourceVisual || visual.Compositor != sourceVisual.Compositor)
        throw new ArgumentException("Use distinct visuals from the same compositor.");

    var previousOpacity = (float)target.Opacity;
    visual.Opacity = previousOpacity;
    var expression = visual.Compositor.CreateExpressionAnimation("source.Opacity * gain");
    expression.SetReferenceParameter("source", sourceVisual);
    expression.SetScalarParameter("gain", 0.5f);
    visual.StartAnimation("Opacity", expression);

    return () =>
    {
        visual.StopAnimation("Opacity");
        // Workaround (checked on 12.1.4, internal behavior): force a base-value
        // resync even if the UI-side value never changed. Re-verify on upgrades.
        visual.Opacity = previousOpacity == 0f ? 1f : 0f;
        visual.Opacity = previousOpacity;
        expression.ClearAllParameters();
    };
}

Reference parameters follow the referenced composition property. Scalar/vector value parameters are copied when StartAnimation is called; changing gain afterward requires restarting the animation to apply it. Avoid expressions that feed a target property back into itself.

On 12.1.4, this reference expression updates when its source property changes after the animation has been committed. Arrange the target's initial appearance separately if it must match before the first source change. Cleanup explicitly writes the base opacity: StopAnimation disconnects the animation, and assigning the unchanged UI-side value alone can leave the last rendered value in place.

11.3: the parameter APIs exist, but this live-reference recipe did not update in the 11.3.22 rendering check. Keep UI-driven relationships on ordinary bindings/transitions on that version rather than assuming the 12.1 behavior.

Coordinated animation group (12.1 and 11.3)

Set each animation's Target before adding it to the group. This example fades and scales a visual from 96% of its current scale; use a dedicated wrapper if another behavior owns its scale or opacity. Keep the base values at the final state (opacity from target.Opacity, the current scale) so the renderer's first synchronization does not cancel the animation and nothing snaps back after it finishes; the keyframes define its initial appearance. Vector3KeyFrameAnimation keyframes use System.Numerics.Vector3, including when the visual's property is exposed as Vector3D.

csharp
using System;
using System.Numerics;
using Avalonia.Controls;
using Avalonia.Rendering.Composition;

static Action StartReveal(Control target)
{
    var visual = ElementComposition.GetElementVisual(target) ?? throw new InvalidOperationException("Attach the target first.");
    var compositor = visual.Compositor;
    var previousOpacity = (float)target.Opacity;
    if (previousOpacity == 0f) return () => { };

    // Base values stay at the final state; keyframe 0 supplies the start.
    visual.Opacity = previousOpacity;
    var previousScale = visual.Scale;
    var finalScale = new Vector3((float)previousScale.X, (float)previousScale.Y, (float)previousScale.Z);
    var startScale = finalScale * new Vector3(0.96f, 0.96f, 1f);

    var fade = compositor.CreateScalarKeyFrameAnimation();
    fade.Target = "Opacity";
    fade.Duration = TimeSpan.FromMilliseconds(180);
    fade.InsertKeyFrame(0f, 0f);
    fade.InsertKeyFrame(1f, previousOpacity);

    var scale = compositor.CreateVector3KeyFrameAnimation();
    scale.Target = "Scale";
    scale.Duration = fade.Duration;
    scale.InsertKeyFrame(0f, startScale);
    scale.InsertKeyFrame(1f, finalScale);

    var group = compositor.CreateAnimationGroup();
    group.Add(fade);
    group.Add(scale);
    visual.StartAnimationGroup(group);

    return () =>
    {
        visual.StopAnimationGroup(group);
        // Workaround (checked on 11.3.22 / 12.1.4, internal behavior): writing an
        // unchanged base value may not resync the renderer after StopAnimationGroup,
        // so write a different value first, then restore. Re-verify on upgrades.
        visual.Opacity = 0f;
        visual.Opacity = previousOpacity;
        visual.Scale = default;
        visual.Scale = previousScale;
    };
}

Call either helper from AttachedToVisualTree or later and store the returned cleanup action. Invoke and clear it before restarting the effect and from DetachedFromVisualTree, on the UI dispatcher. Recreate visuals/animations after reattachment; do not reuse a compositor from another window. Honor the application's reduced-motion preference by skipping the reveal and showing the final state immediately. Composition animations do not provide the control's semantic loading/selection state.

The group was rendered and its cleanup checked on 11.3.22 / 12.1.4; the live-reference expression was checked on 12.1.4. For an added slide effect, 12.0+ Translation avoids changing layout-owned Offset; 11.x has no Translation, so animate a dedicated wrapper's transform or handle Offset ownership explicitly.

ICustomDrawOperation + Skia

Draw with context.Custom(op) from Render(DrawingContext). ICustomDrawOperation : IDisposable, IEquatable<ICustomDrawOperation> — members Bounds, HitTest(Point), Render(ImmediateDrawingContext).

csharp
using Avalonia.Platform; using Avalonia.Rendering.SceneGraph; using Avalonia.Skia; using SkiaSharp;

public override void Render(DrawingContext context)
    => context.Custom(new SkOp(new Rect(Bounds.Size), _phase));

sealed class SkOp(Rect bounds, float phase) : ICustomDrawOperation
{
    public Rect Bounds { get; } = bounds;
    public bool HitTest(Point p) => Bounds.Contains(p);
    public bool Equals(ICustomDrawOperation? other) => other is SkOp o && o.Bounds == Bounds && o.phase == phase;
    public void Dispose() { }

    public void Render(ImmediateDrawingContext context)
    {
        var feature = context.TryGetFeature<ISkiaSharpApiLeaseFeature>();
        if (feature is null) return;                        // non-Skia backend: draw a fallback
        using var lease = feature.Lease();                  // always dispose
        var canvas = lease.SkCanvas;                        // also: GrContext, SkSurface, CurrentOpacity
        canvas.Save();
        using var paint = new SKPaint { Color = SKColors.OrangeRed, IsAntialias = true };
        canvas.DrawCircle((float)Bounds.Width / 2, (float)Bounds.Height / 2, 30 + phase, paint);
        canvas.Restore();
    }
}
  • Types are [Unstable] — pin the Avalonia version and expect changes.
  • The lease canvas inherits Avalonia's current transform/clip; Save()/Restore() around your work.
  • Equals drives dirty-rect/scene diffing: return false (or compare real state) when content changed, else the op may be skipped.
  • Operations run on the render thread: capture immutable data in the op; never touch controls or AvaloniaProperty values inside Render.
  • lease.TryLeasePlatformGraphicsApi() gives access to the native GPU context for GL/Vulkan interop (advanced).
  • Package: Avalonia.Skia (+ SkiaSharp via Avalonia's dependency; match its SkiaSharp version).

OpenGL (OpenGlControlBase)

Namespace Avalonia.OpenGL.Controls.

csharp
public class GlView : OpenGlControlBase
{
    protected override void OnOpenGlInit(GlInterface gl)    { /* create shaders, buffers */ }
    protected override void OnOpenGlDeinit(GlInterface gl)  { /* delete GL objects */ }
    protected override void OnOpenGlLost()                  { /* context lost: drop cached handles */ }
    protected override void OnOpenGlRender(GlInterface gl, int fb)
    {
        // fb = framebuffer to render into; issue GL calls through gl, then:
        RequestNextFrameRendering();                        // keep animating (InvalidateVisual is obsolete here)
    }
}
  • protected GlVersion GlVersion { get; } reports the negotiated context.
  • Rendering happens on the render/composition path, not necessarily the UI thread — no UI access in the overrides.
  • For GL function loading, bindings like Silk.NET are commonly wired from gl.GetProcAddress (check the binding's Avalonia sample).
  • (12.1+) X11 supports OpenGL desktop profiles when rendering through EGL, and the Wayland backend does too; stencil buffers on by default (more HW-accelerated clipping).
  • Deeper GPU interop (external memory, shared textures) lives under Avalonia.OpenGL/ISkiaSharpApiLease.TryLeasePlatformGraphicsApi() — unstable; read the source samples.

WriteableBitmap / ILockedFramebuffer

csharp
var bmp = new WriteableBitmap(new PixelSize(256, 256), new Vector(96, 96),
                              PixelFormat.Bgra8888, AlphaFormat.Premul);
using (var fb = bmp.Lock())                                 // ILockedFramebuffer
{
    // fb.Address (IntPtr), fb.RowBytes (stride), fb.Size, fb.Format, fb.AlphaFormat, fb.Dpi
    unsafe { var p = (uint*)fb.Address; /* respect RowBytes, not Width*4 */ }
}
image.Source = bmp;                                         // re-Lock + write, then image.InvalidateVisual()
  • From existing memory: new WriteableBitmap(PixelFormat format, AlphaFormat alphaFormat, IntPtr data, PixelSize size, Vector dpi, int stride) (data is copied).
  • (12.0+) ILockedFramebuffer.AlphaFormat exists; custom new LockedFramebuffer(...) requires an AlphaFormat argument. Bitmap.CopyPixels(...) no longer takes an AlphaFormat parameter — the format comes from the source framebuffer.
  • (12.1+) Creating bitmaps directly from pixel data is several times faster (no API change).
  • Format/AlphaFormat of Skia-backed bitmaps is typically Bgra8888/Premul — write premultiplied alpha.

NativeControlHost (embed native widgets)

NativeControlHost : Control — subclass and return an IPlatformHandle (Handle IntPtr, HandleDescriptor string?).

csharp
public class NativeHost : NativeControlHost
{
    protected override IPlatformHandle CreateNativeControlCore(IPlatformHandle parent)
    {
        // Create the native widget parented to parent.Handle, then return an IPlatformHandle
        // wrapping it (Handle = HWND / NSView pointer / X11 window id, HandleDescriptor = its kind).
        // Implement IPlatformHandle yourself (or use PlatformHandle if present in your version).
        return base.CreateNativeControlCore(parent);        // placeholder: replace with your handle
    }
    protected override void DestroyNativeControlCore(IPlatformHandle control) { /* destroy native object */ }
}
  • TryUpdateNativeControlPosition() forces re-layout of the native child if it drifts.
  • Native widgets are airspace-bound: they paint above Avalonia content; Avalonia controls (popups, adorners) cannot overlap them. Use a separate top-level (e.g. a Window/overlay) for floating UI.
  • Rendering of the hosted widget is the OS's job — no Avalonia clipping/transforms/opacity apply.
  • Prefer Avalonia.Controls.WebView (NativeWebView) over hand-rolled web embedding (see avalonia-versions).

Hosting Avalonia Elsewhere

HostHow
WinFormsPackage Avalonia.Win32.Interoperability; WinFormsAvaloniaControlHost (WinForms Control, property Content = Avalonia Control)
WinUI 3 (12.1+)Package Avalonia.WinUI (net10.0-windows10.0.19041, depends on Windows App SDK)
Any custom hostEmbeddableControlRoot (Avalonia.Controls.Embedding)
csharp
// WinForms form: after Avalonia has been initialised once for the process
var host = new WinFormsAvaloniaControlHost { Content = new MyAvaloniaView(), Dock = DockStyle.Fill };
Controls.Add(host);
  • (12.0+) WinFormsAvaloniaMessageFilter (IMessageFilter) routes keyboard messages WinForms would otherwise swallow to Avalonia windows; WinFormsAvaloniaControlHost also implements IMessageFilter. Register it via the standard WinForms Application.AddMessageFilter if keys/tab/shortcuts misbehave in hosted views.
  • (12.0+) EmbeddableControlRoot owns rendering: root.Prepare(), root.StartRendering(), root.StopRendering(), Dispose(). TopLevel.StartRendering/StopRendering were removed in 12.
  • In 12.x do not cast a visual root to TopLevel: use TopLevel.GetTopLevel(visual), or GetPresentationSource() → RootVisual for non-TopLevel hosts (VisualExtensions.GetVisualRoot removed).
  • WPF interop: no WPF host type is documented for 12.x in the API reference; verify against the package before promising it.

Text Shaping & Rendering Backends

csharp
// 12.x with explicit Skia: shaping is configured separately
AppBuilder.Configure<App>().UsePlatformDetect();            // handles Skia + HarfBuzz for you
// or
AppBuilder.Configure<App>().UseSkia().UseHarfBuzz();        // (12.0+) needs Avalonia.HarfBuzz package
  • Missing UseHarfBuzz() → InvalidOperationException: No text shaping system configured.
  • (12.0+) AppBuilder.UseTextShapingSubsystem(Action initializer, string name) registers a custom shaper; UseHarfBuzz() is the standard one.
  • Skia is the only renderer in 12. Avalonia.Direct2D1/UseDirect2D1() is (11.x) only → UseSkia().
  • Custom backend authors (12): IRenderTarget.CreateDrawingContext takes RenderTargetSceneInfo; ISkiaGpu is internal; IRenderTarget2/ISkiaGpuRenderTarget2 merged into their base interfaces.
  • (12.1+, experimental) Native Wayland: package Avalonia.Wayland, .UseWayland() or .UsePlatformDetect().UseWaylandWithFallback() (keeps the prior backend when no compositor). Renders via EGL (optional dmabuf). UsePlatformDetect() alone does not pick Wayland. Options: register WaylandPlatformOptions in AvaloniaLocator.
  • (12.1+) X11 and Windows (non-WinUIComposition modes; WinUIComposition remains Windows default) render at monitor refresh rate instead of 60 FPS. Time-based animation stays correct; per-frame work (custom handlers, GL) costs more — drive by CompositionNow/elapsed time, not frame counts.
  • (12.1+) Multiple dirty-rect clipping off by default.

Common Mistakes

  • Calling ElementComposition.GetElementVisual before attach (returns null) or caching a visual across compositors/windows.
  • Forgetting RegisterForNextAnimationFrameUpdate() every frame — the loop silently stops.
  • Setting a custom visual's Size once and never updating it on resize (nothing draws / clips wrong).
  • Touching UI-thread state from CompositionCustomVisualHandler/ICustomDrawOperation.Render/OnOpenGlRender — copy data in or use SendHandlerMessage.
  • Not disposing the Skia lease, or assuming Skia is present (TryGetFeature can return null; headless/other backends).
  • ICustomDrawOperation.Equals always true → stale frames; always false → needless redraws.
  • Using InvalidateVisual() on OpenGlControlBase (obsolete) instead of RequestNextFrameRendering().
  • Writing pixels with Width * 4 instead of fb.RowBytes; writing straight alpha into a premultiplied buffer.
  • Overlapping Avalonia UI on a NativeControlHost and expecting z-order to work.
  • Using TopLevel.StartRendering or GetVisualRoot in 12.x; UseSkia() without UseHarfBuzz(); UseDirect2D1() in 12.x.
  • Assuming UsePlatformDetect() selects Wayland in 12.1.

Sources

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Avalonia Interop Rendering؟

Use when going beyond Render()/DrawingContext in Avalonia — Composition API (ElementComposition, CompositionCustomVisualHandler, implicit/expression animations and animation groups), ICustomDrawOperation with direct SkiaSharp access, OpenGlControlBase, WriteableBitmap/ILockedFramebuffer pixel work, NativeControlHost embedding native HWND/NSView, hosting Avalonia in WinForms/WinUI or EmbeddableControlRoot, text-shaping setup (UseSkia + UseHarfBuzz), or choosing/configuring rendering backends (Skia, Wayland, refresh rate).

لماذا تستخدم Avalonia Interop Rendering على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Avalonia Interop Rendering عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Avalonia Interop Rendering في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-interop-rendering. يقرأ TypingMind ملف SKILL.md الخاص بها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Avalonia Interop Rendering؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Avalonia Interop Rendering؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Avalonia Interop Rendering معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Avalonia Interop Rendering مجانية؟

نعم. نشرها linuxdevel على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇