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
Repo is here.
I got lucky and guessed a way to make ItemsControl work - my luck has run out with Combobox.
Combobox
Templated control vs custom control : microsoft/microsoft-ui-xaml#3371
Themes/Generic.xaml:
Themes/Generic.xaml
ItemsControl - works:
<ItemsControl x:Name="peopleItemsControl" ui:FrameworkElementExtensions.AncestorType="local:PeopleControl" ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=People}" > <ItemsControl.ItemTemplate> <DataTemplate> <ToggleSwitch ui:FrameworkElementExtensions.AncestorType="local:PeopleControl" OnContent="{Binding Name}" OffContent="{Binding Name}" > <Interactivity:Interaction.Behaviors> <Interactions:EventTriggerBehavior EventName="Toggled"> <Interactions:InvokeCommandAction Command="{Binding (ui:FrameworkElementExtensions.Ancestor).TogglePersonCommand, ElementName=layoutRoot, Mode=TwoWay}" CommandParameter="{Binding}"> </Interactions:InvokeCommandAction> </Interactions:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> </ToggleSwitch> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl>
Combobox - does not work:
<ComboBox ui:FrameworkElementExtensions.AncestorType="local:PeopleControl" Width="150" DisplayMemberPath="Name" ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=People}" SelectionChangedTrigger="Always" > <!--Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TogglePersonCommand}"--> <Interactions:EventTriggerBehavior EventName="SelectionChanged"> <Interactions:InvokeCommandAction Command="{Binding (ui:FrameworkElementExtensions.Ancestor).TogglePersonCommand, ElementName=layoutRoot, Mode=TwoWay}" CommandParameter="{Binding SelectedItem}"> </Interactions:InvokeCommandAction> </Interactions:EventTriggerBehavior> </ComboBox>
PeopleControl.cs:
PeopleControl.cs
TogglePersonCommand = new AsyncRelayCommand<object>(TogglePersonCommandHandler, (o) => { return true; // never fired for combobox });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Repo is here.
I got lucky and guessed a way to make ItemsControl work - my luck has run out with
Combobox
.Templated control vs custom control : microsoft/microsoft-ui-xaml#3371
Themes/Generic.xaml
:ItemsControl - works:
Combobox - does not work:
PeopleControl.cs
:The text was updated successfully, but these errors were encountered: