View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001557 | NoesisGUI | C++ SDK | public | 2019-09-30 06:54 | 2019-10-11 10:32 |
| Reporter | tkawa | Assigned To | sfernandez | ||
| Priority | normal | Severity | feature | ||
| Status | resolved | Resolution | no change required | ||
| Product Version | 2.2.5 | ||||
| Target Version | 2.2.6 | Fixed in Version | 2.2.6 | ||
| Summary | 0001557: Support FontSizeConverter to convert string to float | ||||
| Description | Follow up from https://www.noesisengine.com/forums/viewtopic.php?f=3&t=1817 I'd like to bind FontSize and specify "pt". XAML <TextBlock FontSize="{Binding FontSize}"... />cpp float GetFontSize() const{ | ||||
| Platform | Windows | ||||
|
I've been doing some tests in WPF and it looks like WPF doesn't allow that either. <TextBlock Text="This text's size is bound to a string" FontSize="{Binding TextSize}"/>public class ViewModel DataContext = new ViewModel { TextSize = "30pt" };I was surprised by this behavior because I though WPF will use TypeConverter attribute specified in the FontSize property, but I found that bindings ignore that attribute and only use TargetProperty.PropertyType to decide which dynamic converter it should create. In this situation is creating a SystemConvertConverter that just calls Convert.ChangeType from String to Double which is trying to parse a double from the string, and is failing because of the "pt" suffix. At the end FontSizeConverter is only used when parsing the xaml, and we already support that, should we close this? |
|
|
I see it. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2019-09-30 06:54 | tkawa | New Issue | |
| 2019-09-30 10:03 | sfernandez | Assigned To | => sfernandez |
| 2019-09-30 10:03 | sfernandez | Status | new => assigned |
| 2019-09-30 10:03 | sfernandez | Product Version | => 2.2.5 |
| 2019-09-30 10:03 | sfernandez | Target Version | => 2.3.0 |
| 2019-10-04 17:08 | sfernandez | Summary | Suppoert FontSizeConverter to convert string to float => Support FontSizeConverter to convert string to float |
| 2019-10-04 17:08 | sfernandez | Description Updated | |
| 2019-10-04 17:09 | sfernandez | Description Updated | |
| 2019-10-04 17:10 | sfernandez | Description Updated | |
| 2019-10-10 12:34 | sfernandez | Status | assigned => feedback |
| 2019-10-10 12:34 | sfernandez | Note Added: 0005989 | |
| 2019-10-11 05:02 | tkawa | Description Updated | |
| 2019-10-11 05:25 | tkawa | Note Added: 0005990 | |
| 2019-10-11 05:25 | tkawa | Status | feedback => assigned |
| 2019-10-11 10:31 | sfernandez | Status | assigned => resolved |
| 2019-10-11 10:31 | sfernandez | Resolution | open => no change required |
| 2019-10-11 10:31 | sfernandez | Fixed in Version | => 2.2.6 |
| 2019-10-11 10:32 | sfernandez | Target Version | 2.3.0 => 2.2.6 |