- darthmaule2
- Posts: 98
- Joined:
Missing functions in needed for creating a custom panel in managed C# SDK
I see that MeasureOverride and ArrangeOverride were added in the latest BETA... Great!
But it appears I'm still missing a few functions. My class looks like this:
I'm currently using these functions from WPF's VirtualizingPanel implementation that I can't find under Noesis:
And this Panel property:
The only thing that I think I really need from that list is OnItemsChanged. I'm not sure if "InternalChildren" is the same as the existing Noesis Children property, if so, then I'm good there. The rest would be nice to have but probably not absolutely necessary.
But it appears I'm still missing a few functions. My class looks like this:
Code: Select all
class VirtualizingTilePanel : Noesis.VirtualizingPanel, Noesis.IScrollInfo
Code: Select all
protected void AddInternalChild(UIElement child)
protected void InsertInternalChild(Int32 index, UIElement child)
protected void RemoveInternalChildRange(Int32 index, Int32 range)
protected override void OnItemsChanged(object sender, ItemsChangedEventArgs e)
Code: Select all
protected internal System.Windows.Controls.UIElementCollection InternalChildren { get; }
-
sfernandez
Site Admin
- Posts: 2997
- Joined:
Re: Missing functions in needed for creating a custom panel in managed C# SDK
Panel's InternalChildren property is just the same as Children, so you can use that.
All the Add/Insert/Remove Child methods are just redirected to the children collection, so you can use Children.Add/Insert/Remove instead.
And you can subscribe to the ItemsChanged event on the ItemContainerGenerator of the corresponding ItemsControl, something like this:
Anyway these are functions that should be in the base classes in the future, so could you please report it in our bugtracker so we can keep track of this?
All the Add/Insert/Remove Child methods are just redirected to the children collection, so you can use Children.Add/Insert/Remove instead.
And you can subscribe to the ItemsChanged event on the ItemContainerGenerator of the corresponding ItemsControl, something like this:
Code: Select all
public class VirtualizingTilePanel : Noesis.VirtualizingPanel, Noesis.IScrollInfo
{
public VirtualizingTilePanel()
{
Loaded += (s, e) =>
{
ItemsControl itemsControl = ItemsControl.GetItemsOwner(this);
itemsControl?.Generator?.ItemsChanged += OnItemsChanged;
}
}
private void OnItemsChanged(object sender, ItemsChangedEventArgs e)
{
}
}
- darthmaule2
- Posts: 98
- Joined:
Re: Missing functions in needed for creating a custom panel in managed C# SDK
Thanks for the work-arounds. Here's the bug:
https://www.noesisengine.com/bugs/view.php?id=1385
https://www.noesisengine.com/bugs/view.php?id=1385
Re: Missing functions in needed for creating a custom panel in managed C# SDK
Thanks for the report!