# \<Match\> inside ux:Class

**URL:** <https://forums.fusetools.com/t/match-inside-ux-class/3970>\
**Category:** Bug Reports\
**Created:** [March 28, 2016, 7:32am UTC](https://forums.fusetools.com/t/match-inside-ux-class/3970 "2016-03-28T07:32:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bjorn-Olav\_Strand](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bjorn-olav_strand/32/583_2.png) [@Bjorn-Olav\_Strand](https://forums.fusetools.com/u/Bjorn-Olav_Strand)\
**Post date:** [March 28, 2016, 7:32am UTC](https://forums.fusetools.com/t/match-inside-ux-class/3970/1 "2016-03-28T07:32:57Z")

</div>

I’m trying to use `<Match>` with `ux:Property` and I’m getting `E2009: Call to 'Fuse.Controls.PropertyBinding<object>(Uno.UX.Property<object>,Uno.UX.Property<object>)' has some invalid arguments`

How is flow control with properties supported?

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [March 28, 2016, 10:06am UTC](https://forums.fusetools.com/t/match-inside-ux-class/3970/2 "2016-03-28T10:06:16Z")

</div>

Hi!

For a property binding, the source and desitination properties must have identical type (known limitiation). If you post the full code, I can help spot the error.

---

<div class="post-metadata">

**Author:** ![Bjorn-Olav\_Strand](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bjorn-olav_strand/32/583_2.png) [@Bjorn-Olav\_Strand](https://forums.fusetools.com/u/Bjorn-Olav_Strand)\
**Post date:** [March 28, 2016, 8:21pm UTC](https://forums.fusetools.com/t/match-inside-ux-class/3970/3 "2016-03-28T20:21:17Z")

</div>

```
    <StackPanel ux:Class="DateItemTemplate" ux:Name="self" ClipToBounds="false" Margin="0" Background="#fff">
        <string ux:Property="Day" />
        <string ux:Property="Date" />
        <float4 ux:Property="TextColor" />
        <float4 ux:Property="LineColor" />
        <Match Value="{Property self.Day}">
            <Case String="Mon">
                <Text Value="{Property self.Day}" TextColor="{Property self.TextColor}" Font="RobotoMedium" Alignment="Center" FontSize="13" />
            </Case>
        </Match>
        <Text Value="{Property self.Date}" TextColor="{Property self.TextColor}" Font="RobotoMedium" Alignment="Center" FontSize="20" />
        <Rectangle Height="3" Width="74">
            <SolidColor Color="{Property self.LineColor}" />
        </Rectangle>
    </StackPanel>

```

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [March 30, 2016, 12:22pm UTC](https://forums.fusetools.com/t/match-inside-ux-class/3970/4 "2016-03-30T12:22:31Z")

</div>

`Match.Value` is of type `object` and cannot be property-bound to a `string` in 0.11. This is a known limitation and we have a ticket for improving it.

A work-around for now is using `<Match String="{Property self.Day}">`

---

<div class="post-metadata">

**Author:** ![Fernando\_Lins](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/fernando_lins/32/597_2.png) [@Fernando\_Lins](https://forums.fusetools.com/u/Fernando_Lins)\
**Post date:** [September 19, 2016, 2:54am UTC](https://forums.fusetools.com/t/match-inside-ux-class/3970/5 "2016-09-19T02:54:30Z")

</div>

Just wanted to bring up the fact that it has been this way since `0.11` (current version is `0.25.1`). Is this still something that is going to be “fixed” or has it been cancelled/re-evaluated and not going to change?

It caused me some headache while migrating code from using observables (`<Match Value="{someVar}"> <Case String="someValue"> ...`) to using `ux:Property`(ies) (`<Match String="{Property this.aProperty}"> <Case String="someString"> ...`) inside a `ux:Class`.

The error message seemed to say something was wrong with the types I was declaring for each `ux:Property` instead of being related to `Match`:

```auto
E8001: Cannot bind property 'Value' (object) to 'FileNewStatus' (bool), the types don't match. If you created the property 'FileNewStatus', consider changing its type to 'object'.

```

Changing `<bool ux:Property="FileNewStatus" />` to `<object ux:Property="FileNewStatus" />` as the error seems to suggest doesn’t fix the issue, as noted.

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [September 19, 2016, 4:36am UTC](https://forums.fusetools.com/t/match-inside-ux-class/3970/6 "2016-09-19T04:36:31Z")

</div>

Hi!

Not really sure what you mean, but best practice now is as follows:

Instead of

```
<Each>
    <Match Value="{foo}">
       <Case String="bar" > 
           <Panel> ...

```

Do

```
<Each MatchKey="foo">
     <Panel ux:Template="bar">...
```
