How to interact with Avalonia application embeded into Angular application?

Discussão em 'Angular' iniciado por VRa3, Fevereiro 26, 2025.

  1. VRa3

    VRa3 Guest

    I'm learning the Avalonia framework and my goal was to embed it into an existing Angular application. To accomplish this, I used an iframe and passed the source to index.html generated by dotnet publish command, it worked just as expected.

    The Avalonia application I created is a simple 5 question quiz and my Angular application has 2 routes:

    • setup parameters view: A text input assigned to a global service variable,
    • wasm view: A route where iframe shows the Avalonia app.

    Now I would like to implement some communication between the two. My goals are:

    1. Pass a variable value (string) from Angular to Avalonia, let's say it should be available once the Avalonia application is loaded.
    2. Emit a message/event from Avalonia to Angular.

    I'm thinking about window.postMessage() method or creating a custom Event, but how do I use it in Avalonia?

    Continue reading...

Compartilhe esta Página