Universal Windows Platform (UWP)
A Microsoft platform for building and publishing apps for Windows desktop devices.
2,934 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi
I try to bind the left of margin but get syntax error
Margin="{x:Bind Path= classsize.widtharea} , 20 ,0 ,0 "
Thanks
You can use a converter:
<Page.Resources>
<local:MarginConverter x:Key="MarginConverter" />
</Page.Resources>
[...]
Margin="{x:Bind classsize, Converter={StaticResource MarginConverter}}"
converter implementation, replace YourClass with your actual class
public class MarginConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
var classsize = (YourClass)value;
return new Thickness(classsize.widtharea, 20, 0, 0);
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}