Skip to content
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

[IR-ext] selection support for complex ItemTemplate #611

Open
Xiaoy312 opened this issue Jun 13, 2023 · 1 comment · May be fixed by #618
Open

[IR-ext] selection support for complex ItemTemplate #611

Xiaoy312 opened this issue Jun 13, 2023 · 1 comment · May be fixed by #618
Assignees
Labels
control/extensions-helpers-markup Related to attached properties, helper classes, or markup extensions without a finer tag kind/enhancement New feature or request.

Comments

@Xiaoy312
Copy link
Contributor

Anything else we need to know?

By design, IR-extensions only properly supports selection if the root element in the item-template is a SelectorItem derived class.

What would you like to be added:

Allow the target element of selection to be not just the template root.

This should probably be done through some marker property, ex:

<muxc:ItemsRepeater ItemsSource="ASD"
					utu:ItemsRepeaterExtensions.SelectionMode="Single">
	<muxc:ItemsRepeater.ItemTemplate>
		<DataTemplate> 
			<Border>
				<utu:Chip Content="{Binding}" utu:ItemsRepeaterExtensions.IsSelectionTarget="True" />
			</Border>
		</DataTemplate>
	</muxc:ItemsRepeater.ItemTemplate>
</muxc:ItemsRepeater>

or

<muxc:ItemsRepeater ItemsSource="ASD"
					utu:ItemsRepeaterExtensions.SelectionMode="Single"
					utu:ItemsRepeaterExtensions.SelectionTargetName="Selectable">
	<muxc:ItemsRepeater.ItemTemplate>
		<DataTemplate> 
			<Border>
				<utu:Chip x:Name="Selectable" Content="{Binding}" />
			</Border>
		</DataTemplate>
	</muxc:ItemsRepeater.ItemTemplate>
</muxc:ItemsRepeater>

Why is this needed:

In figma, we often encounter case where it is impossible to generate a "clean/lean" item-template. And, we need to support these scenario, where the targeted SelectorItem can be found nested under the item-template.

For which Platform: all

@Xiaoy312 Xiaoy312 added kind/enhancement New feature or request. control/extensions-helpers-markup Related to attached properties, helper classes, or markup extensions without a finer tag labels Jun 13, 2023
@Xiaoy312 Xiaoy312 self-assigned this Jun 13, 2023
@Xiaoy312
Copy link
Contributor Author

re: unoplatform/Uno.Figma#1612

@Xiaoy312 Xiaoy312 linked a pull request Jun 16, 2023 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control/extensions-helpers-markup Related to attached properties, helper classes, or markup extensions without a finer tag kind/enhancement New feature or request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant