Match Case Grouping

Is it possible to accomplish the same thing with UX the way we handle javascript switch case like the following:

	case "1":
	case "2":
	case "3":

This is because I have several ui groups based on an id like in the following:

<Match String="{id}">
	<Case String="1">
			<Text Value="Display UI for One" />
	<Case String="2">
			<mob.IconAccount />
	<Case String="3">
			<Text Value="Display UI for Three" />
	<Case String="4">
			<mob.IconAccount />
			<Text Value="{name}" />

Using IsDefault will not be enough as it only handles one group that share the same UI traits. What I am trying to avoid is having to duplicate the same UI over and over again under different cases. I have about 8 cases to handle.


You will want to use Each with MatchKey which allows you to match on a given property in your list items and make use of templates (see the second example in the link).

Match/Case combo is much more memory intensive and should be avoided.

Thanks for the tip Uldis. I kind of noticed the performance issue when I ran it in my android phone. Initially, I was under the impression that MatchKey is doing the same thing but now I think I know the trick.