Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does GroupingNode need a resize completed event to implement undo resize? #16

Closed
Yokosama opened this issue Jun 7, 2021 · 4 comments
Closed
Assignees
Labels
enhancement New feature or enhancement question Further information is requested

Comments

@Yokosama
Copy link

Yokosama commented Jun 7, 2021

Hi, i want to implement undo resize when GroupingNode resize completed. It looks like i need to add an event? or is there any other solution? Thank you.

@Yokosama Yokosama added the question Further information is requested label Jun 7, 2021
@miroiu
Copy link
Owner

miroiu commented Jun 7, 2021

Hi, you can bind to the GroupingNode.ActualSize property which is only set when the resize is completed.
Example from Playground app:

<DataTemplate DataType="{x:Type local:CommentNodeViewModel}">
    <nodify:GroupingNode ActualSize="{Binding Size}"
                         Header="{Binding Title}" />
</DataTemplate>
private Size _size;
public Size Size
{
    get => _size;
    set => SetProperty(ref _size, value); // you can record the change in here
}

Please let me know if that helps.

@Yokosama
Copy link
Author

Yokosama commented Jun 8, 2021

I've tried this code and it's very helpful to me.Thank you.
It should be noted that when deserializing a graph, need to check whether it is in deserialization, otherwise record will be executed once.

@miroiu miroiu added the enhancement New feature or enhancement label Jun 8, 2021
@miroiu
Copy link
Owner

miroiu commented Jun 8, 2021

Added ResizeCompleted event and ResizeCompletedCommand in commit 12a8d2f
Let me know if this is what you need. Thanks!

@Yokosama
Copy link
Author

Yokosama commented Jun 9, 2021

Yes, that's what I need. Thank you very much.

@Yokosama Yokosama closed this as completed Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants