This question is locked. New answers and comments are not allowed.
Hi,
I found a possible bug. I reported a bug that was similar in an earlier support ticket but I think this is located somewhere else.
What I'm doing is that I'd like to animate a Listbox-Item when it's first displayed on screen so that items doesn't just "pop in" when I use IsAsyncBalanceEnabled. The best way I found to do that was by handling it that way in the ItemStateChanged event handler:
Most of the time this works fine althought I think IsItemInViewport does returns more items than needed (sometimes 25 if I don't start scrolling while about 5 are really on screen) but the animation framework is performant enough that animating more items than what are really on screen doesn't impact the app performance too much.
Btw it would be great if the DataBoundListBox could support item animations (on insert, on remove, ...) out of the box in a future version.
But now to the exception. Most of the time it works perfect, but sometimes i get a "Parameter is wrong" exception on IsItemInViewport call. The e.DataItem is correctly filled with an object at this time.
Here's the stack trace:
bei MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
bei MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
bei MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)
bei System.Windows.UIElement.TransformToVisual(UIElement visual)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.IsItemInViewport(Object dataItem)
bei bpk.feed7.View.FolderView.UnreadListBox_ItemStateChanged(Object sender, ItemStateChangedEventArgs e)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.OnItemStateChanged(Object item, ItemState state)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.OnContainerStateChanged(RadVirtualizingDataControlItem container, IDataSourceItem item, ItemState state)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.GetContainerForItem(IDataSourceItem item, Int32 insertAt)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.GetContainerForItem(IDataSourceItem item, Boolean insertLast)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.ManageVisualSequenceFromViewportBottom()
bei Telerik.Windows.Controls.RadVirtualizingDataControl.BalanceVisualSpace()
bei Telerik.Windows.Controls.RadVirtualizingDataControl.OnBalanceTimerTick(Object sender, EventArgs e)
bei System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
bei MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
I can again send you my current source code if you need, but it's not 100 % reproducable, althought it happens on a pretty regular basis so after a while playing around in the app, it will appear.
Thanks
Bernhard
I found a possible bug. I reported a bug that was similar in an earlier support ticket but I think this is located somewhere else.
What I'm doing is that I'd like to animate a Listbox-Item when it's first displayed on screen so that items doesn't just "pop in" when I use IsAsyncBalanceEnabled. The best way I found to do that was by handling it that way in the ItemStateChanged event handler:
private
void
UnreadListBox_ItemStateChanged(
object
sender, ItemStateChangedEventArgs e)
{
if
(e.State == ItemState.Realized && UnreadListBox.IsItemInViewport(e.DataItem))
{
var item = (
this
.UnreadListBox.GetContainerForItem(e.DataItem));
RadAnimationManager.Play(item, tileAnimation);
}
}
Most of the time this works fine althought I think IsItemInViewport does returns more items than needed (sometimes 25 if I don't start scrolling while about 5 are really on screen) but the animation framework is performant enough that animating more items than what are really on screen doesn't impact the app performance too much.
Btw it would be great if the DataBoundListBox could support item animations (on insert, on remove, ...) out of the box in a future version.
But now to the exception. Most of the time it works perfect, but sometimes i get a "Parameter is wrong" exception on IsItemInViewport call. The e.DataItem is correctly filled with an object at this time.
Here's the stack trace:
bei MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
bei MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
bei MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)
bei System.Windows.UIElement.TransformToVisual(UIElement visual)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.IsItemInViewport(Object dataItem)
bei bpk.feed7.View.FolderView.UnreadListBox_ItemStateChanged(Object sender, ItemStateChangedEventArgs e)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.OnItemStateChanged(Object item, ItemState state)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.OnContainerStateChanged(RadVirtualizingDataControlItem container, IDataSourceItem item, ItemState state)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.GetContainerForItem(IDataSourceItem item, Int32 insertAt)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.GetContainerForItem(IDataSourceItem item, Boolean insertLast)
bei Telerik.Windows.Controls.RadVirtualizingDataControl.ManageVisualSequenceFromViewportBottom()
bei Telerik.Windows.Controls.RadVirtualizingDataControl.BalanceVisualSpace()
bei Telerik.Windows.Controls.RadVirtualizingDataControl.OnBalanceTimerTick(Object sender, EventArgs e)
bei System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
bei MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
I can again send you my current source code if you need, but it's not 100 % reproducable, althought it happens on a pretty regular basis so after a while playing around in the app, it will appear.
Thanks
Bernhard