-
Notifications
You must be signed in to change notification settings - Fork 50
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
Using Command and ComboBox is not working in SettingsExpander.Items #445
Comments
@ghost1372 can you clarify what you mean by "if i dont use SettingsExpander.Items everything is working normal, but if i use SettingsExpander.Items command is not working"? Also, what version of WinUI 3 are you using? This seems like it'd be an issue with scope and binding vs. specific to the control itself. Do you see the command has been bound to the property? Can you setup a repro of the problem in the https://github.com/michael-hawker/WinUI2Plus3Template? And see if the same problem occurs in UWP as well? (@Arlodotexe we should link to this template in the issue template for folks) |
@michael-hawker Items Placing items in the ItemsHeader, ItemsFooter and Content works well, But placing items in the Items section does not work. i am using latest version: 1.3.1 and today i tested with 1.3.2.
this is a winui 3 sample repro. i tested in uwp and is not working too. |
I actually think I modified the repro to show the behavior difference between <ItemsControl ItemsSource="{x:Bind ViewModel.Items}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="x:String">
<ComboBox Name="cmbTest1">
<ComboBoxItem Content="TextBlock" Tag="TextBlock" />
<ComboBoxItem Content="HyperLink" Tag="HyperLink" />
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="SelectionChanged">
<ic:EventTriggerBehavior.Actions>
<ic:InvokeCommandAction Command="{Binding ElementName=PageRoot, Path=ViewModel.Test1Command}" CommandParameter="{Binding ElementName=cmbTest1}" />
</ic:EventTriggerBehavior.Actions>
</ic:EventTriggerBehavior>
</i:Interaction.Behaviors>
</ComboBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ItemsRepeater Grid.Column="1" ItemsSource="{x:Bind ViewModel.Items}">
<ItemsRepeater.ItemTemplate>
<DataTemplate x:DataType="x:String">
<ComboBox Name="cmbTest1">
<ComboBoxItem Content="TextBlock" Tag="TextBlock" />
<ComboBoxItem Content="HyperLink" Tag="HyperLink" />
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="SelectionChanged">
<ic:EventTriggerBehavior.Actions>
<ic:InvokeCommandAction Command="{Binding ElementName=PageRoot, Path=ViewModel.Test2Command}" CommandParameter="{Binding ElementName=cmbTest2}" />
</ic:EventTriggerBehavior.Actions>
</ic:EventTriggerBehavior>
</i:Interaction.Behaviors>
</ComboBox>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater> And this is what happens: Recording.2023-06-19.011441.mp4I'm using |
@michael-hawker can you please fix this issue? |
@leoshusar @ghost1372 Am I understanding correctly that this bug also appears in a standalone If so, this seems to be an |
Yes, I remember now, there is an issue for this that already exists in the WinUI repo here: microsoft/microsoft-ui-xaml#560 (Also probably related: microsoft/microsoft-ui-xaml#2508) I'll post on the issue with a link to @leoshusar's great repro project, thanks! |
Tnx @michael-hawker |
@ghost1372 I've moved it to the top of our tracking list and will investigating raising with WinUI team. Looks like a number of folks up-voted my latest comment on it, but not the issue itself. Those help. We spent a lot of time on this control and needed to use |
Hi @michael-hawker |
Describe the bug
if we use MvvM Command in ComboBox and SettingsExpander.Items, The command is not executed.
Steps to reproduce
if i dont use SettingsExpander.Items everything is working normal, but if i use SettingsExpander.Items command is not working
The text was updated successfully, but these errors were encountered: