-
-
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
ComboBox / Popup crashes after Theme switching. Other controls work as expected. #15115
Comments
I tried to override all the brushes that are found here through this method, but it doesn't work quite as it should, because many colors are not changed. For example, the color of the text, which makes changing the theme look very strange. The original method looks much simpler and changes the theme as it should, except that the ComboBox crashes the whole application for some reason. In this post was attached an example with disabled virtualization of ComboBox and some array. But as far as I know, in the latest version virtualization was removed from ComboBox. |
Yes I saw that, and I can confirm that My interim workaround (which could become the permanent workaround) is to use a However, it would be nice, though not essential, to be able to use a <Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:FalconProgrammer.ViewModel"
x:Class="FalconProgrammer.Views.ColourSchemeWindow"
x:DataType="vm:ColourSchemeWindowViewModel">
<ComboBox
ItemsSource="{Binding ColourSchemes}"
SelectedItem="{Binding ColourScheme}" />
</Window> And here's the code behind: public partial class ColourSchemeWindow : Window {
public ColourSchemeWindow() {
InitializeComponent();
}
protected override void OnLoaded(RoutedEventArgs e) {
var viewModel = (ColourSchemeWindowViewModel)DataContext!;
viewModel.ChangeColourScheme += ViewModelOnChangeColourScheme;
}
private static void ViewModelOnChangeColourScheme(object? sender, ColourSchemeId e) {
// This is just a static method that changes the theme's colour scheme to the one indicated by
// the method's enum parameter.
ColourScheme.Select(e);
}
} To clarify, the application crash happens for me if, having already used the |
Here I've simplified this example even further, getting rid of absolutely everything superfluous. In this example, the themes are not applied at all. If I apply one of the themes, I lose AccentColor, and all other colors are not changed at all. If I replace
On
Then I have SystemAccentColor replaced, but still this method does not work in any way on other colors, it is not applied in any way.
MainWindowViewModel.cs
What else do I have to send you to show you that this code doesn't work????
Only SystemAccentColor is changed and that's it, other colors are not affected.
unknown_2024.03.22-14.55.mp4
Originally posted by @H4CK3R0FF1C14L in #15072 (reply in thread)
The text was updated successfully, but these errors were encountered: