Topic Author
Posts: 3
Joined: 15 Feb 2018, 22:23

Binding and Converters not working for RowDefinition Height in Unity

15 Feb 2018, 22:36

Hey there. I'm trying to Dynamically set the RowDefinition Height for a Grid. I have tried the following two methods:

Method: Binding to GridLength in ViewModel
<RowDefinition x:Name="HeaderRow" Height="{Binding HeaderRowHeight}"/>
private Noesis.GridLength headerRowHeight;
        public Noesis.GridLength HeaderRowHeight
            get { return headerRowHeight; }
            private set
                headerRowHeight = value;
HeaderRowHeight = new Noesis.GridLength(500000f);
This method of binding works elsewhere in my project on TextBlocks Text being bound to strings and Button Commands being bound to commands. In this case however, the row remains at the default value of "*".

Method: Use of Converter
<RowDefinition x:Name="FooterRow" 
                Height="{Binding ActualHeight, 
                        Converter={StaticResource SetGridLengthPercentageConverter}, 
Converter Code:
public class SetGridLengthPercentageConverter : IValueConverter

        public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
            string fullValueString = value.ToString();
            string percentageWantedString = parameter.ToString();

            double fullValue = System.Convert.ToDouble(fullValueString);
            double percentageWanted = System.Convert.ToDouble(percentageWantedString);

            return new GridLength((float)(fullValue * (percentageWanted / 100)));
            return null;

        public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
            throw new System.NotImplementedException();
Error Received in Unity:
InvalidOperationException: Native type is not registered
Noesis.Extend.GetNativeTypeInfo (IntPtr nativeType) (at Assets/NoesisGUI/Plugins/API/Core/NoesisExtend.cs:481)

Again, I have Converters working in other parts of the view. So it's just this one that does not work. I saw that a similar problem got fixed a couple years ago on the trello board, am I wrong to assume this still holds?
User avatar
Site Admin
Posts: 3067
Joined: 22 Dec 2011, 19:20

Re: Binding and Converters not working for RowDefinition Height in Unity

20 Feb 2018, 21:39

Could you please report it in our bugtracker, this seems like GridLength type is not working when used in bindings/converters from Unity.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests