# Can't make ux:Property for FontSize

**URL:** <https://forums.fusetools.com/t/cant-make-ux-property-for-fontsize/2670>\
**Category:** Bug Reports\
**Created:** [April 12, 2016, 4:17pm UTC](https://forums.fusetools.com/t/cant-make-ux-property-for-fontsize/2670 "2016-04-12T16:17:43Z")\
**Posts on this page:** 8\
**Page:** 1

<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:** [April 12, 2016, 4:17pm UTC](https://forums.fusetools.com/t/cant-make-ux-property-for-fontsize/2670/1 "2016-04-12T16:17:43Z")

</div>

I am trying to make a custom Panel class that will set properties to an inner Text node. I was able to pass most of Text’s properties but `FontSize` is not accepted. Here’s the sample code:

```auto
<Panel>
    <Panel ux:Class="Icon" Width="32" Height="32" TextColor="{Resource darkBlue}" FontSize="12" Value="">
        <float ux:Property="FontSize" />
        <string ux:Property="Value" />
        <float4 ux:Property="TextColor" />
        <TextAlignment ux:Property="TextAlignment" />

        <Text Font="IconFont" TextColor="{Property this.TextColor}" TextAlignment="{Property this.TextAlignment}" FontSize="{Property this.FontSize}" Value="{Property this.Value}" />
    </Panel>

    <Icon FontSize="20" Value="&#xE872;"/>
</Panel>

```

However I get an error on `<float ux:Property="FontSize" />`:

```auto
....\build\Local\Preview66\cache\Icon.g.uno(99.21): E2009: Call to 'Fuse.Controls.PropertyBinding<float>(Uno.UX.Property<float>,Uno.UX.Property<float>)' has some invalid arguments (TowardDemo_FuseControlsText_FontSize_Property,TowardDemo_Icon_FontSize_Property)

```

```auto
....\build\Local\Preview66\cache\MainView.g.uno(1566.17): E3107: 'Icon' does not contain a member called 'FontSizeProperty'. Could you be missing a package reference?

```

Documentation says `FontSize` is of type `float` so I don’t know what’s going on here.

---

<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:** [April 12, 2016, 4:34pm UTC](https://forums.fusetools.com/t/cant-make-ux-property-for-fontsize/2670/2 "2016-04-12T16:34:59Z")

</div>

I tried changing the Property to `<float ux:Property="IconSize" />` and the same error happens:

```auto
build\Local\Preview74\cache\MainView.g.uno(1563.17): E3107: 'Icon' does not contain a member called 'IconSizeProperty'. Could you be missing a package reference?

```

---

<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:** [May 9, 2016, 2:36pm UTC](https://forums.fusetools.com/t/cant-make-ux-property-for-fontsize/2670/3 "2016-05-09T14:36:50Z")

</div>

Hi,

Sorry for the late reply. Looks like you are trying to set the custom FontSize proeprty from a `Style`, which is deprecated.

Let us know if the problem persists after eliminating styles from your project.

---

<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:** [May 9, 2016, 8:59pm UTC](https://forums.fusetools.com/t/cant-make-ux-property-for-fontsize/2670/4 "2016-05-09T20:59:15Z")

</div>

Hi Anders,

I don’t use `Style` in my code at all since it’s been deprecated. I converted all of my `Style` blocks to `ux:Classes` like the one above.

---

<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:** [May 9, 2016, 9:05pm UTC](https://forums.fusetools.com/t/cant-make-ux-property-for-fontsize/2670/5 "2016-05-09T21:05:37Z")

</div>

Hi,

A new big release is right around the corner. If the problem persists there, can you provide a full test case please?

---

<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:** [May 11, 2016, 8:07am UTC](https://forums.fusetools.com/t/cant-make-ux-property-for-fontsize/2670/6 "2016-05-11T08:07:23Z")

</div>

After closer investigation this appears to be a bug in the current version (0.12.x) and I don’t have a good suggestion for a work-around for the bug. Sorry for the inconveniecne.

The good news is that I am unable to reproduce the issue in the next version that will be released soon. (I expect this version to go on #pre-release-testing some time today.)

---

<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:** [May 11, 2016, 3:12pm UTC](https://forums.fusetools.com/t/cant-make-ux-property-for-fontsize/2670/7 "2016-05-11T15:12:19Z")

</div>

Hi Anders, thank you for the reply.

I also noticed that if I create an `ux:Class` and try to add a `ux:Property` to an instance of it, I get the same errors as above (on 0.12.4):

```auto
<Panel ux:Class="RoundButton" Label="Click Me">
    <string ux:Property="Label">
    <Text Value="{Property this.Label}" Alignment="Center" />
</Panel>

<RoundButton Diameter="100" ux:Name="firstButton">
    <!-- Adding a property to an instance of a ux:Class -->
    <Size ux:Property="Diameter" />
    <Circle Width="{Property firstButton.Diameter}" Height="{Property firstButton.Diameter}" Fill="#FF0000" Layer="Background" />
</RoundButton>

```

Error: `MainView.g.uno(1563.17): E3107: 'RoundButton' does not contain a member called 'Diameter'. Could you be missing a package reference?`

---

<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:** [May 11, 2016, 3:15pm UTC](https://forums.fusetools.com/t/cant-make-ux-property-for-fontsize/2670/8 "2016-05-11T15:15:36Z")

</div>

You cannot add `ux:Property` to an instance, only to `ux:Class`'es.

The error message is poor, though. I’ll take note of that.
