Hi,
I am currently defining few grids as following:
<Grid.RowDefinitions>
<RowDefinition Height="{TemplateBinding Height-Height/5}"/>
<RowDefinition Height="{TemplateBinding Height/15}"/>
<RowDefinition Height="{TemplateBinding Height/20}"/>
<RowDefinition Height="{TemplateBinding Height/6}"/>
</Grid.RowDefinitions>
While the division works fine , the subtraction isn't yielding the output.
Ialso tried like following:
<RowDefinition Height="{TemplateBinding Height-(Height/5)}"/>
Still no result. Any suggestions plz.
Thanks,
Subhen
**
Update
**
Now In My XAML I tried implementing the IvalueConverter like :
<RowDefinition Height="{TemplateBinding Height, Converter={StaticResource heightConverter}}"/>
Added the reference as
<local:medieElementHeight x:Key="heightConverter"/>
In side generic.cs I have coded as following:
public class medieElementHeight : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
//customVideoControl objVdeoCntrl=new customVideoControl();
double custoMediaElementHeight = (double)value;//objVdeoCntrl.customMediaPlayer.Height;
double mediaElementHeight = custoMediaElementHeight - (custoMediaElementHeight / 5);
return mediaElementHeight;
}
#region IValueConverter Members
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
#endregion
}
But getting the exception Unknown Element Height in the element RowDefination.