We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This seems to have got broken by #4855: adding combo box items when the dropdown is opened now causes the dropdown to be measured incorrectly:
<Window xmlns="https://github.com/avaloniaui" xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' x:Class="Sandbox.MainWindow"> <ComboBox Name="cb" Items="{Binding Items}" SelectedIndex="{Binding SelectedIndex}" VirtualizationMode="Simple"/> </Window>
public class MainWindow : Window { public MainWindow() { this.InitializeComponent(); this.AttachDevTools(); var vm = new ViewModel(); var cb = this.FindControl<ComboBox>("cb"); cb.GetObservable(ComboBox.IsDropDownOpenProperty).Skip(1).Subscribe(x => { if (x) { vm.DropDownOpened(); } else { vm.DropDownClosed(); } }); DataContext = vm; } private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } } public class ViewModel : ReactiveObject { private int _selectedIndex = 0; public ObservableCollection<string> Items { get; } = new ObservableCollection<string> { "foo" }; public int SelectedIndex { get => _selectedIndex; set => this.RaiseAndSetIfChanged(ref _selectedIndex, value); } public void DropDownOpened() { var items = new[] { "foo", "bar", "baz" }; Items.Clear(); foreach (var i in items) { Items.Add(i); } SelectedIndex = 1; } public void DropDownClosed() { Items.Clear(); Items.Add("bar"); SelectedIndex = 0; } }
cc: @donandren
The text was updated successfully, but these errors were encountered:
Fixed by #4895
Sorry, something went wrong.
No branches or pull requests
This seems to have got broken by #4855: adding combo box items when the dropdown is opened now causes the dropdown to be measured incorrectly:
cc: @donandren
The text was updated successfully, but these errors were encountered: