OnVisualChildrenChanged not found
Good afternoon. In WPF, you can override the OnVisualChildrenChanged method to work with changing child elements inside the element. The method is not detected in Noesis. I work with my custom StackPanel. Source: https://learn.microsoft.com/en-us/dotne ... esktop-8.0
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: OnVisualChildrenChanged not found
As it happens with GetLayoutClip, this method is not yet exposed to C#, could you also add this to our bugtracker?
Re: OnVisualChildrenChanged not found
Is there information about collections in various elements? Removed, added, etc. events?? In ItemsControl, I also didn't notice any tools for working with the collection.
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: OnVisualChildrenChanged not found
Thanks for the report.
The ObservableCollection has the CollectionChanged event, but ItemsControl.OnItemsChanged virtual method is not exposed to C# either. If you need it please report that too.Is there information about collections in various elements? Removed, added, etc. events?? In ItemsControl, I also didn't notice any tools for working with the collection.
Re: OnVisualChildrenChanged not found
That is, there are no ways to work with child elements inside the panel? As with ItemsControl, etc.?
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: OnVisualChildrenChanged not found
We didn't initially expose all the API to C# because when working with a MVVM pattern you don't usually need to deal with custom controls. Instead you work with ObservableCollections to interact with the collections of items in your data model.
Could you elaborate a bit more what are you trying to accomplish?
Could you elaborate a bit more what are you trying to accomplish?
Re: OnVisualChildrenChanged not found
Sometimes there are times when decisions need to be made quickly, without MVVM. For example, create your own layout mechanisms in Panel, etc. Otherwise, for simple examples, you would constantly have to create some kind of complex wrapper of business logic.
In this case, I wanted to modify the StackPanel and add something like Spacing to it. In WPF, I would just redefine OnVisualChildrenChanged and add space to the child elements. Then you would have your own custom panel that could be used both with and without MVVM.
But I think you can also do it through MeasureOverride and ArrangeOverride, which turned out in another example: viewtopic.php?t=2936 .
In this case, I wanted to modify the StackPanel and add something like Spacing to it. In WPF, I would just redefine OnVisualChildrenChanged and add space to the child elements. Then you would have your own custom panel that could be used both with and without MVVM.
But I think you can also do it through MeasureOverride and ArrangeOverride, which turned out in another example: viewtopic.php?t=2936 .
Who is online
Users browsing this forum: No registered users and 24 guests