miroiu / nodify

Highly performant and modular controls for node-based editors designed for data-binding and MVVM.
https://miroiu.github.io/nodify
MIT License
1.3k stars 208 forks source link

[Question] Bring the selected node on top? #57

Closed trrahul closed 1 year ago

trrahul commented 1 year ago

Hi. Is it possible to bring the selected node on top? Currently the last added node comes on top of all other nodes and if you select others they are behind the last added one.

miroiu commented 1 year ago

Hi! Yes, it is possible. Here's an example:

<nodify:NodifyEditor.ItemContainerStyle>
    <Style TargetType="{x:Type nodify:ItemContainer}"
           BasedOn="{StaticResource {x:Type nodify:ItemContainer}}">
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Panel.ZIndex" Value="1" />
            </Trigger>
        </Style.Triggers>
    </Style>
</nodify:NodifyEditor.ItemContainerStyle>

bringtofront

I'll also add this to be the default for the Playground app.

trrahul commented 1 year ago

Thanks for the quick answer. I tired the code, and it worked.