View Issue Details

IDProjectCategoryView StatusLast Update
0002729NoesisGUIUnitypublic2024-01-29 12:58
Reporterjphyzic Assigned Tojsantos  
PrioritynormalSeverityminor 
Status resolvedResolutionfixed 
Product Version3.2 
Target Version3.2.3Fixed in Version3.2.3 
Summary0002729: Can not bind to Point properties X and Y
Description

Binding to a property of type Noesis.Point pointing either to Point.X or Point.Y property fails with a warning
[NOESIS/W] Can't solve PropertyPath: Type 'Point' does not contain a property named 'Y' followed by a Binding failed error.

Note: I'm using Noesis in Unity and currently updating it from 3.1.4 to 3.2.2. The error was not present in 3.1.4. A similar problem is present in 3.1.4 for Rect class - only Width and Height properties may be bound (haven't checked it in 3.2.2), so I had to use a custom converter as a workaround.

PlatformAny

Activities

jsantos

jsantos

2023-10-16 20:45

manager   ~0008831

You are right, Point is incorrectly exposing "x" and "y" properties (lowercase).

But I see that Rect class is properly exposing "X", "Y", "Width" and "Height", even in 3.1.4. Could you please paste your converter here?

jphyzic

jphyzic

2023-10-17 08:15

reporter   ~0008836

I'm sorry, I double-checked and indeed, X, Y, Width and Height properties of the Rect can be used with binding. However, other properties like IsEmpty, Top, Bottom, Location etc. still can not be bound to. It was some time ago, so I've confused the exact names of the properties that were causing problems. I've used a simple converter to extract the properties I needed:

public class RectPropertyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == DependencyProperty.UnsetValue)
return DependencyProperty.UnsetValue;

        var r = (Rect)value;
        return parameter switch
        {
            nameof(r.Width) => r.Width,
            nameof(r.Height) => r.Height,
            nameof(r.Left) => r.Left,
            nameof(r.Right) => r.Right,
            nameof(r.Top) => r.Top,
            nameof(r.Bottom) => r.Bottom,
            nameof(r.X) => r.X,
            nameof(r.Y) => r.Y,
            nameof(r.Location) => r.Location,
            nameof(r.Size) => r.Size,
            nameof(r.TopLeft) => r.TopLeft,
            nameof(r.TopRight) => r.TopRight,
            nameof(r.BottomLeft) => r.BottomLeft,
            nameof(r.BottomRight) => r.BottomRight,
            _ => r
        };
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}
jsantos

jsantos

2023-10-17 11:56

manager   ~0008837

Thanks for this!

jsantos

jsantos

2024-01-29 12:58

manager   ~0009134

Properties renamed to "X" and "Y"
Added IsEmpty, Left, Top, Right, Bottom To Rect. Unfortunately, the other properties can't be added until the next reflection system.

Thanks for your feedback!

Issue History

Date Modified Username Field Change
2023-10-16 16:53 jphyzic New Issue
2023-10-16 18:12 sfernandez Assigned To => sfernandez
2023-10-16 18:12 sfernandez Status new => assigned
2023-10-16 18:12 sfernandez Target Version => 3.2.3
2023-10-16 20:45 jsantos Note Added: 0008831
2023-10-17 08:15 jphyzic Note Added: 0008836
2023-10-17 11:56 jsantos Note Added: 0008837
2024-01-22 11:47 sfernandez Target Version 3.2.3 => 3.2.4
2024-01-22 11:53 sfernandez Assigned To sfernandez => jsantos
2024-01-22 11:53 sfernandez Target Version 3.2.4 => 3.2.3
2024-01-29 12:58 jsantos Status assigned => resolved
2024-01-29 12:58 jsantos Resolution open => fixed
2024-01-29 12:58 jsantos Fixed in Version => 3.2.3
2024-01-29 12:58 jsantos Note Added: 0009134
2025-10-10 13:29 jsantos Category Unity3D => Unity