1
votes

there's a very special case in my Project with Xamarin.Forms (V2.5) Entry.

I got a nested Grid with a button and two entries (also nested in a frame) in it. The button is bound to my VM and sets the visibility of these entries (if true, hide one and - over a converter - pop up the other). The text-properties of the entries are bound to a public string property in my VM in mode=twoway.

If I tap that "switch" (Button), in UWP everything is working fine.

But on the Android-Emulator, the entries are only white and without any function. Please take a look at these Screenshots: Screenshot 1 Screenshot 2 to see the difference.

I can't explain myself this behaviour. Converter do his job and value-transfer to VM looks perfect.

And here is some XAML code of the nested grid:

<Grid x:Name="InnerGridSparrateSwitch" Grid.Row="3" Grid.Column="1" IsVisible="{Binding IsFH}"
                      HorizontalOptions="Fill">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="1*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"/>
                        <ColumnDefinition Width="1.5*"/>
                    </Grid.ColumnDefinitions>

                    <Button Text="{Binding Spareingabe}" Style="{StaticResource OnPlatformButton}"
                        Command="{Binding SwitchSpareingabe}"
                        Grid.Row="0" Grid.Column="0"
                        FontAttributes="Bold"
                        BackgroundColor="{DynamicResource AccentColor}"/>
                    <Frame Style="{StaticResource RunderRahmen}"
                           Grid.Row="0" Grid.Column="1">
                        <Entry x:Name="Eingabe_FHRate"
                               IsVisible="{Binding EingabeSparRate}"
                               Style="{StaticResource Eingabefeld_small}"
                               Text="{Binding SparrateView, Mode=TwoWay}"

                               IsEnabled="{Binding AutoCalcActive, Converter={StaticResource IsBusyConverter}}"/>
                    </Frame>
                    <Frame Style="{StaticResource RunderRahmen}"
                           Grid.Row="0" Grid.Column="1">
                        <Entry x:Name="Eingabe_SparProzent"

                           IsVisible="{Binding EingabeSparRate, Converter={StaticResource IsBusyConverter}}"
                           Style="{StaticResource Eingabefeld_small}"
                           Text="{Binding TilgungssatzView, Mode=TwoWay}"/>
                    </Frame>

                </Grid>
                <!--#endregion-->
                <!--#region Switch Tilgungsrate/Promille/€-->
                <Grid x:Name="InnerGridTilgungsrateSwitch" Grid.Row="4" Grid.Column="1" IsVisible="{Binding IsFH}"
                      HorizontalOptions="Fill">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="1*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"/>
                        <ColumnDefinition Width="1.5*"/>
                    </Grid.ColumnDefinitions>

                    <Button Text="{Binding TBEingabe}" Style="{StaticResource OnPlatformButton}"
                        Command="{Binding SwitchTBEingabe}"
                        Grid.Row="0" Grid.Column="0"
                        FontAttributes="Bold"
                        BackgroundColor="{DynamicResource AccentColor}"/>
                    <Frame Style="{StaticResource RunderRahmen}"
                           Grid.Row="0" Grid.Column="1">
                        <Entry x:Name="Eingabe_TBRate"
                               IsVisible="{Binding EingabeTilgungsRate}"
                               Style="{StaticResource Eingabefeld_small}"
                               Text="{Binding TBView, Mode=TwoWay}"
                               Placeholder="Tilgungsrate"
                               IsEnabled="{Binding AutoCalcActive, Converter={StaticResource IsBusyConverter}}"/>
                    </Frame>
                    <Frame Style="{StaticResource RunderRahmen}"
                           Grid.Row="0" Grid.Column="1">
                        <Entry x:Name="Eingabe_TBPromille"

                           IsVisible="{Binding EingabeTilgungsRate, Converter={StaticResource IsBusyConverter}}"
                           Style="{StaticResource Eingabefeld_small}"
                           Text="{Binding TBSatzView}"/>
                    </Frame>

                </Grid>

Thank you very much!

1

1 Answers

0
votes

Finally got it! I've placed the IsVisible Property in the CHILD (Entry) instead in the PARENT (Frame). Because I've set the "padding" property of my OnPlatform frame-style ("RunderRahmen") to 0 I couldn't see any problems (white frame without an entry on android) on UWP.

WRONG

<Frame Style="{StaticResource RunderRahmen}"
                       Grid.Row="0" Grid.Column="1">
                    <Entry x:Name="Eingabe_SparProzent"

                       IsVisible="{Binding EingabeSparRate, Converter={StaticResource IsBusyConverter}}"
                       Style="{StaticResource Eingabefeld_small}"
                       Text="{Binding TilgungssatzView, Mode=TwoWay}"/>
                </Frame>

RIGHT

<Frame Style="{StaticResource RunderRahmen}"
                           Grid.Row="0" Grid.Column="1"
IsVisible="{Binding EingabeSparRate, Converter={StaticResource IsBusyConverter}}">
                        <Entry x:Name="Eingabe_SparProzent"


                           Style="{StaticResource Eingabefeld_small}"
                           Text="{Binding TilgungssatzView, Mode=TwoWay}"/>
                    </Frame>