You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a BindableLayout (here) representing tabs (think of browser tabs) and an ObservableCollection (here) representing those tabs.
Whenever I ask to switch the order of the tabs (click here), I get the following exception:
System.Runtime.InteropServices.COMException: 'No installed components were detected.
stacktrace:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at WinRT.DelegateExtensions.DynamicInvokeAbi(Delegate del, Object[] invoke_params)
at ABI.System.Collections.Generic.IVectorMethods`1.Append(IObjectReference obj, T value)
at ABI.System.Collections.Generic.IListMethods`1.Add(IObjectReference obj, T item)
at Microsoft.UI.Xaml.Controls.UIElementCollection.Add(UIElement item)
at Microsoft.Maui.Handlers.ContentViewHandler.UpdateContent(IContentViewHandler handler) in C:\maui\src\Core\src\Handlers\ContentView\ContentViewHandler.Windows.cs:line 26
at Microsoft.Maui.Handlers.ContentViewHandler.MapContent(IContentViewHandler handler, IContentView page) in C:\maui\src\Core\src\Handlers\ContentView\ContentViewHandler.Windows.cs:line 46
at Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass5_0.<Add>b__0(IElementHandler h, IElement v) in C:\maui\src\Core\src\PropertyMapper.cs:line 172
at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView) in C:\maui\src\Core\src\PropertyMapper.cs:line 47
at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView) in C:\maui\src\Core\src\PropertyMapper.cs:line 82
at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view) in C:\maui\src\Core\src\Handlers\Element\ElementHandler.cs:line 79
at Microsoft.Maui.Handlers.ViewHandler`2.SetVirtualView(IView view) in C:\maui\src\Core\src\Handlers\View\ViewHandlerOfT.cs:line 53
at Microsoft.Maui.Handlers.ContentViewHandler.SetVirtualView(IView view) in C:\maui\src\Core\src\Handlers\ContentView\ContentViewHandler.Windows.cs:line 9
at Microsoft.Maui.Handlers.ViewHandler`2.SetVirtualView(IElement view) in C:\maui\src\Core\src\Handlers\View\ViewHandlerOfT.cs:line 56
at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler) in C:\maui\src\Controls\src\Core\Element\Element.cs:line 922
at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value) in C:\maui\src\Controls\src\Core\Element\Element.cs:line 864
at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value) in C:\maui\src\Controls\src\Core\VisualElement\VisualElement.cs:line 2061
at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context) in C:\maui\src\Core\src\Platform\ElementExtensions.cs:line 96
at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context) in C:\maui\src\Core\src\Platform\ElementExtensions.cs:line 127
at Microsoft.Maui.Handlers.LayoutHandler.SetVirtualView(IView view) in C:\maui\src\Core\src\Handlers\Layout\LayoutHandler.Windows.cs:line 33
at Microsoft.Maui.Handlers.ViewHandler`2.SetVirtualView(IElement view) in C:\maui\src\Core\src\Handlers\View\ViewHandlerOfT.cs:line 56
at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler) in C:\maui\src\Controls\src\Core\Element\Element.cs:line 922
at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value) in C:\maui\src\Controls\src\Core\Element\Element.cs:line 864
at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value) in C:\maui\src\Controls\src\Core\VisualElement\VisualElement.cs:line 2061
at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context) in C:\maui\src\Core\src\Platform\ElementExtensions.cs:line 96
at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context) in C:\maui\src\Core\src\Platform\ElementExtensions.cs:line 127
at Microsoft.Maui.Handlers.LayoutHandler.Insert(Int32 index, IView child) in C:\maui\src\Core\src\Handlers\Layout\LayoutHandler.Windows.cs:line 60
at Microsoft.Maui.Handlers.LayoutHandler.MapInsert(ILayoutHandler handler, ILayout layout, Object arg) in C:\maui\src\Core\src\Handlers\Layout\LayoutHandler.cs:line 101
at Microsoft.Maui.CommandMapper`2.<>c__DisplayClass6_0.<Add>b__0(IElementHandler h, IElement v, Object o) in C:\maui\src\Core\src\CommandMapper.cs:line 105
at Microsoft.Maui.CommandMapper.InvokeCore(String key, IElementHandler viewHandler, IElement virtualView, Object args) in C:\maui\src\Core\src\CommandMapper.cs:line 33
at Microsoft.Maui.CommandMapper.Invoke(IElementHandler viewHandler, IElement virtualView, String property, Object args) in C:\maui\src\Core\src\CommandMapper.cs:line 51
at Microsoft.Maui.Handlers.ElementHandler.Invoke(String command, Object args) in C:\maui\src\Core\src\Handlers\Element\ElementHandler.cs:line 95
at Microsoft.Maui.Controls.Layout.NotifyHandler(String action, Int32 index, IView view) in C:\maui\src\Controls\src\Core\Layout\Layout.cs:line 339
at Microsoft.Maui.Controls.Layout.OnInsert(Int32 index, IView view) in C:\maui\src\Controls\src\Core\Layout\Layout.cs:line 323
at Microsoft.Maui.Controls.Layout.Insert(Int32 index, IView child) in C:\maui\src\Controls\src\Core\Layout\Layout.cs:line 238
at Microsoft.Maui.Controls.BindableLayout.Insert(IBindableLayout layout, Object item, Int32 index) in C:\maui\src\Controls\src\Core\BindableLayout\BindableLayout.cs:line 156
at Microsoft.Maui.Controls.BindableLayoutController.<>c__DisplayClass39_0.<ItemsSourceCollectionChanged>b__0(Object item, Int32 index, Boolean _) in C:\maui\src\Controls\src\Core\BindableLayout\BindableLayout.cs:line 392
at Microsoft.Maui.Controls.Internals.NotifyCollectionChangedEventArgsExtensions.Apply(NotifyCollectionChangedEventArgs self, Action`3 insert, Action`2 removeAt, Action reset) in C:\maui\src\Controls\src\Core\Internals\NotifyCollectionChangedEventArgsExtensions.cs:line 59
at Microsoft.Maui.Controls.BindableLayoutController.ItemsSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in C:\maui\src\Controls\src\Core\BindableLayout\BindableLayout.cs:line 391
at Microsoft.Maui.Controls.WeakNotifyCollectionChangedProxy.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in C:\maui\src\Controls\src\Core\Internals\WeakEventProxy.cs:line 78
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at Maui.Controls.Sample.MainPage.Button_Clicked(Object sender, EventArgs e) in C:\maui\src\Controls\samples\Controls.Sample.Sandbox\MainPage.xaml.cs:line 29
at Microsoft.Maui.Controls.Button.Microsoft.Maui.Controls.Internals.IButtonElement.PropagateUpClicked() in C:\maui\src\Controls\src\Core\Button\Button.cs:line 275
at Microsoft.Maui.Controls.ButtonElement.ElementClicked(VisualElement visualElement, IButtonElement ButtonElementManager) in C:\maui\src\Controls\src\Core\Button\ButtonElement.cs:line 40
at Microsoft.Maui.Controls.Button.SendClicked() in C:\maui\src\Controls\src\Core\Button\Button.cs:line 250
at Microsoft.Maui.Controls.Button.Microsoft.Maui.IButton.Clicked() in C:\maui\src\Controls\src\Core\Button\Button.cs:line 484
at Microsoft.Maui.Handlers.ButtonHandler.OnClick(Object sender, RoutedEventArgs e) in C:\maui\src\Core\src\Handlers\Button\ButtonHandler.Windows.cs:line 95
at WinRT._EventSource_global__Microsoft_UI_Xaml_RoutedEventHandler.EventState.<GetEventInvoke>b__1_0(Object sender, RoutedEventArgs e)
at ABI.Microsoft.UI.Xaml.RoutedEventHandler.Do_Abi_Invoke(IntPtr thisPtr, IntPtr sender, IntPtr e)
Hi @MartyIX. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Description
I have a
BindableLayout
(here) representing tabs (think of browser tabs) and anObservableCollection
(here) representing those tabs.Whenever I ask to switch the order of the tabs (click here), I get the following exception:
stacktrace:
Steps to Reproduce
Controls.Sample.Sandbox
project-> Crash (every time)
When I remove this line https://github.com/MartyIX/maui/blob/7de8a66ed902a9d346d93f520eec24a4fbb3a28b/src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml#L23, the issue is gone but obviously I want to display my custom control.
Link to public reproduction project repository
https://github.com/MartyIX/maui/tree/feature/2024-04-16-ObservableCollection-crash
Version with bug
8.0.20 SR4
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows, I was not able test on other platforms
Affected platform versions
Windows 10, Windows 11
Did you find any workaround?
No.
I have tried #8997 (comment) to no avail.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: