top of page
Search
  • Writer's picturePavel Chuvak

Three features that I liked at Xamarin.Forms 4.7

Shapes & Paths

Finally, Xamarin has got a simple tool that allows us to draw custom layouts and shapes. Previously, any non-standard button or rounding of the layout (especially different from different angles) was challenging and timeconsuming. We had to search for plugins, make the endless study of native documentation, adjust various tricks and tips. But now, when the tool appeared, I am open to new tasks and challenges. Below you may find the list of features that now are available due to the new tool:

  • Clipping — the image is clipped with an ellipse;

  • Path — the background of the login is a path shape of a specific size;

  • Ellipse + Path — the login button at the bottom combines shapes.



Multi-Bindings

Multibinding is the chip that I looked forward to the most. Earlier, I used to come across a situation when the visibility or behavior of an element depends on a combination of factors. Or when the Name and Surname should be displayed in the Entry as a placeholder but as a result, additional properties, behaviors, or converters appeared. All that cluttered up the code and confused the user. Finally, in Xamarin.Forms 4.7, we have a simple and elegant tool that solves all these problems.

<Label>
    <Label.Text>
        <MultiBinding StringFormat="{}{0} {1} {2}">
            <Binding Path="Employee1.Forename" />
            <Binding Path="Employee1.MiddleName" />
            <Binding Path="Employee1.Surname" />
        </MultiBinding>
    </Label.Text></Label>

Simplified Grid Row & Column Definitions

And finally, this feature doesn’t change the development approach or provide us with new control. But it significantly reduces the amount of code and makes a layout more polished. To sum the things up, I am sure that everyone has faced with pages where the biggest part of the code was just a column definition and row definition description. Before:

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="1*" />
        <ColumnDefinition Width="2*" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="300" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="1*" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="25" />
        <RowDefinition Height= "14" />
        <RowDefinition Height="20" />
    </Grid.RowDefinitions></Grid>

After:


<Grid ColumnDefinitions="1*, 2*, Auto, *, 300"
    RowDefinitions="1*, Auto, 25, 14, 20"></Grid>

But now we can be sure that all those days are behind us.


  • Xamarin

  • Xamarin Forms

  • Cross Platform

  • Mobile

  • Mobile App Development


42 views1 comment

1 則留言


admin
2020年8月13日

test


按讚
bottom of page