Skip to content

Windows

Jean-François Pustay edited this page Feb 8, 2021 · 1 revision

Windows are the only way to render something on stride with Avalonia. To allow good interaction with stride with added additional properties.

here an example of additional property

<Window xmlns="https://github.com/avaloniaui"
        xmlns:s="clr-namespace:Stridelonia;assembly=Stridelonia.Avalonia"
        s:WindowExtensions.RenderGroup="31">
</Window>

So let see what we have

Is2D

It allows defining if your window is rendered to the screen or 3d space. By default your window will be on the screen

<Window xmlns="https://github.com/avaloniaui"
        xmlns:s="clr-namespace:Stridelonia;assembly=Stridelonia.Avalonia"
        s:WindowExtensions.Is2D="False">
</Window>

RenderGroup

Allow changing the render group used by stride to render the window. You can use this to solve the problem of clean UI. default to render group 0

<Window xmlns="https://github.com/avaloniaui"
        xmlns:s="clr-namespace:Stridelonia;assembly=Stridelonia.Avalonia"
        s:WindowExtensions.RenderGroup="31">
</Window>

Zindex

Basically the same as Z-index from CSS. Topmost will also work from Avalonia

<Window xmlns="https://github.com/avaloniaui"
        xmlns:s="clr-namespace:Stridelonia;assembly=Stridelonia.Avalonia"
        s:WindowExtensions.ZIndex="1">
</Window>

HasInput

Define if the window will receive input events. by default is true

<Window xmlns="https://github.com/avaloniaui"
        xmlns:s="clr-namespace:Stridelonia;assembly=Stridelonia.Avalonia"
        s:WindowExtensions.HasInput="False">
</Window>

Position3D

Actually, Position from Avalonia also work, but it hard to position something in 3d with a vector2 So Position3D is here Actually, converters do not work correctly. so it better to use code.

WindowExtensions.SetRenderGroup(this, 31);

Rotation3D

Rotation3D is only for 3d space, but you can render transform from Avalonia(the best I could find) Same as Position3D is better to use code.

WindowExtensions.SetRotation3D(this, Quaternion.RotationY(360));
Clone this wiki locally