-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[Bug] ComboBox throws "The control already has a visual parent" error when it's pressed #5441
Comments
Duplicate of #4839 |
Duplicate of #4839 |
@PieroCastillo long story short, the problem is with reusing same combobox items when its template was changed with new children list container. IIRC problem makes sense only with updating list control template while its open and items can't be reused. |
@maxkatz6 THANKSSSSSSSSSSS :DDDDDDDDDDDD <ComboBox SelectedIndex="0"
VirtualizationMode="None"
SelectionChanged="ChangeTheme">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding .}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
<l:ArrayList>
<sys:String>Fluent Light</sys:String>
<sys:String>Fluent Dark</sys:String>
</l:ArrayList>
</ComboBox> |
now all that remains is to improve the performance of the style system. ;) |
App is crashing then changing themes multiple times. Fix similar to: AvaloniaUI/Avalonia#5441 Tested on Windows
Describe the bug
I tried to make a ThemeChanger (like
Avalonia/samples/ControlCatalog/MainView.xaml
Lines 80 to 85 in b6ccad0
To Reproduce
I don't know exactly the causes, so, I'm going to put the code:
App.xaml.cs
MainWindow.xaml
MainWindow.xaml.cs
Expected behavior
Error when the ComboBox is pressed.
Screenshots
Normal App
2021-02-07.22-43-08.mp4
App without custom controls
2021-02-07.22-53-39.mp4
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: