Exploring Xamarin Forms 3.2.0-pre1 Release Features

In this post we are going to explore some of the cool features of xamarin forms which we are going to see in xamarin.forms 3.2.0. Although this release doesn’t contains very big features because only first pre release is out now, but these enhancements are surely useful. Still we can hope for big features and more stability in stable release of 3.2.0 this post is written when first pre release of 3.2.0 comes to our package manager and will be updated when new releases are on our desk. For now we can use these cool enhancements and features in xamarin.forms 3.2.0 pre release 1. List of release features we are going to discuss. Two of my favorite features from this release are added in separate post. You can see from these link. Other features are discussed blow.
  • Commandable Span Regions
Spans are now enriched with gesture recognizer. This feature is added for a reason, that if you are going to add a large text and don’t want to break a labelĀ  to add hyperlink within the text than you can use these span commands. This command can be added to any span and can performs actions you want. Example to use: XAML:
<StackLayout Padding="10">

<Label>
<Label.FormattedText>
<FormattedString>
<Span Text="Here we are adding a large text. "></Span>
<Span Text="A very large Text. " TextColor="Blue">
<Span.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={x:Reference this}, Path=BindingContext.Span1Command}" NumberOfTapsRequired="1"></TapGestureRecognizer>
</Span.GestureRecognizers>
</Span>
<Span Text="Dummy text is just added in span. "></Span>
<Span Text="To understand commands in span."></Span>
<Span Text="Hope this will be helpful."></Span>
</FormattedString>
</Label.FormattedText>
</Label>


</StackLayout>
Code:
public ICommand Span1Command { get; set; }
public MainPage()
{
InitializeComponent();
Span1Command = new Command(Span1_Tapped);
this.BindingContext = this;
}

public async void Span1_Tapped()
{
await App.Current.MainPage.DisplayAlert("Heyyy", "You Just Tapped on Highlighted text", "Ok Sorry!", "Cancel");
}
Output:
  • Round Corner on BoxView
Box views are now upgraded with CornerRadius Property you can set the radius of box view to get corners of your choice. XAML:
<StackLayout Padding="40">

<BoxView CornerRadius="80" HeightRequest="200"
WidthRequest="200" Color="Black"
HorizontalOptions="Center"/>

</StackLayout>
Output:
  • Padding on Buttons
Small but needed enhancements in buttons is to add padding property inside a button. This little addition is surely helpful for developers. XAML:
<StackLayout Padding="10">

<Button Padding="25" Text="Button With Padding"></Button>
<Button Text="Button Without Padding"></Button>

</StackLayout>
Output:
  • Editor Placeholder and PlaceholderColor
People using editors are not blessed with Placeholder and Placeholder color property. This this little useful blessing is given in this release. Although little changes worth a lot this is one of them. XAML:
<StackLayout Padding="10">

<Editor Placeholder="Meet with me. I am a PlaceHolder Text in Editor" PlaceholderColor="Green"></Editor>

</StackLayout>
Output:   *If you are going to use feature from this list than don’t forgot to update your xamarin.forms package to 3.2.  

XamarinWeb Founder | MVP – C-SharpCorner | Xamarin Forms Developer

Leave a Reply

Your email address will not be published. Required fields are marked *