Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Style via idiom not working

$
0
0

Background: wanting to set a grid's rowdefinition and columndefinition height and width respectively via a style, with the setter using an idiom. Idea being grid rows and columns would be smaller on a phone than tablet. This is in a netstandard 2.0 project.

Compiles and runs fine, but has no effect:

<ContentPage.Resources>
        <ResourceDictionary>
            <Style TargetType="RowDefinition">
                <Setter Property="Height">
                    <Setter.Value>
                        <OnIdiom x:TypeArguments="x:Double" Tablet="75" Phone="50" />
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="ColumnDefinition">
                <Setter Property="Width">
                    <Setter.Value>
                        <OnIdiom x:TypeArguments="x:Double" Tablet="75" Phone="50" />
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </ContentPage.Resources>


Wondering if this is a legit bug with netstandard 2.0.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>