For UWP I need a different size for the width of a column in a Grid
. Additionally, the value should be different on tablet and on smartphone.
The following code crashes the app
<ColumnDefinition>
<ColumnDefinition.Width>
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="GridLength" iOS="*" Android="*" WinPhone="100" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="GridLength" iOS="*" Android="*" WinPhone="200" />
</OnIdiom.Tablet>
</ColumnDefinition.Width>
</ColumnDefinition>
with
Type OnIdiom.Phone not found in xmlns http://xamarin.com/schemas/2014/forms
The code is in a ViewCell
. So I can't use an additional ResourceDictionary
and also OnSizeAllocated()
is not available in the code behind file.
Is it possible to use OnIdiom
and OnPlatform
together?