1614130220
Also included in the Xamarin Community Toolkit are the AsyncCommand, AsyncValueCommand. These little helpers can make your code more performant by making your Commands safe to use with Async.
In this episode I am joined by Brandon Minnick, Senior Cloud Advocate at Microsoft who has implemented all of the above and loves to tell you everything about it.
Show Links:
Useful Links:
Get your questions answered on the Microsoft Q&A for .NET - http://aka.ms/dotnet-qa
#Xamarin #MVVM #AsyncCommand #XTC
#xamarin #developer #mobile-apps
1602318660
You may have heard about the Xamarin Community Toolkit by now. This toolkit will be an important part of the Xamarin.Forms ecosystem during the evolution to .NET 6. Now is the time to contribute since it is “Hacktoberfest” after all!
Since Xamarin.Forms 5 will be the last major version of Forms before .NET 6, we wanted to have an intermediate library that can still add value for Forms in the meanwhile. However, why stop there? There is also a lot of converters, behaviors, effects, etc. that everyone is continually rewriting. To help avoid this, we consolidated all of those into the Xamarin Community Toolkit.
This toolkit already has a lot of traction and support from our wonderful community, but there is always room for more! Lucky for us, that time of year which makes contributing extra special is upon us again.
For Hacktoberfest we welcome you all to join us and plant that tree (new reward by Hacktoberfest!) or earn that t-shirt while giving some of your valuable time to our library. On top of that, we will offer some swag whenever you decide to contribute. When you do, we will reach out to you near the end of October and if your PRs are eligible to make sure we get your details. That means: no need to do anything special, just crush that code!
#announcements #events #xamarin #xamarin.forms #hacktoberfest #xamarin community toolkit
1609755091
In this Xamarin Online course, you will learn each and every topic with the help of hands-on labs. This program includes a hands-on live project with the implementation of recommended design patterns and practices. The learning path for this program is given below:
Xamarin Training objective
At the completion of this course, attendees will be able to;
#xamarin training #xamarin course #xamarin forms course #xamarin online course #xamarin forms training #xamarin training course
1626322326
#xamarin
#aspdotnetexplorer
https://www.youtube.com/watch?v=2tehSdX897E
#xamarin forms #xamarin forms bangla tutorials for beginners #xamarin forms tutorials for beginners #xamarin #xamarin.forms #xamarin.forms ui
1650441960
In this post, we are going to see the featured effects available in Xamarin Community Toolkit and how to use them. This post is a part of Xamarin Community Toolkit - Tutorial Series, visit the post to know about the Xamarin Community Toolkit. The Xamarin Community Toolkit is a collection of reusable elements for mobile development with Xamarin.Forms, including animations, behaviors, converters, effects, and helpers. It simplifies and demonstrates common developer tasks when building iOS, Android, macOS, WPF, and Universal Windows Platform (UWP) apps using Xamarin.Forms.
Create New Project by Selecting New Project à Select Xamarin Cross Platform App and Click OK.
Note: Xamarin.Forms version should be greater than 5.0.
Then Select Android and iOS Platforms as shown below with Code Sharing Strategy as PCL or .Net Standard and Click OK.
In this step, we will see how to setup the plugin.
In this step, we will see how to implement the featured effects offered in Xamarin Community Toolkit. Here, we have explained the implementation of Safe Area Effect, Shadow Effect, Life Cycle Effect, and StatusBar Effect.
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
C#
Specifically, it will help to make sure that content isn't clipped by rounded device corners, the home indicator, or the sensor housing on an iPhone X. The effect only targets iOS, meaning that on other platforms it does not do anything.
Properties
<StackLayout xct:SafeAreaEffect.SafeArea="True" BackgroundColor="White"> </StackLayout>
C#
SafeArea
Indicates which safe areas should be taken into account for this element
Before Applying the Effect
After Applying the Effect
It is used to have a shadow effect for Xamarin Forms Views and we have five properties that need to be understood to use this effect.
Properties
In this example, I have updated the shadow effect for the Image Control like in the following code block
<Image
x:Name="img"
HeightRequest="150"
Margin="10"
xct:ShadowEffect.Color="Green"
xct:ShadowEffect.OffsetY="15"
Source="https://shorturl.at/qsvJ1">
</Image>
C#
The LifecycleEffect allows you to determine when a VisualElement has its renderer allocated by the platform. It can be identified by using the LifeCycleEffect event handlers.
<Image
x:Name="img"
HeightRequest="150"
Margin="10"
Source="https://shorturl.at/qsvJ1">
<Image.Effects>
<xct:LifecycleEffect Loaded="LifeCycleEffect_Loaded" Unloaded="LifeCycleEffect_Unloaded" />
</Image.Effects>
</Image>
C#
private void LifeCycleEffect_Loaded(object sender, EventArgs e)
{
Console.WriteLine("Image loaded...");
}
private void LifeCycleEffect_Unloaded(object sender, EventArgs e)
{
Console.WriteLine("Image Unloaded...");
}
C#
In this example, we will create color resource in the App.xaml file like below. It will be updated later dynamically.
<Color x:Key="StatusBarColor">Firebrick</Color>
C#
Then add the following line in the root element of your XAML page as a DynamicResource
xct:StatusBarEffect.Color="{DynamicResource StatusBarColor}"
C#
Then add the 3 buttons like in the sample screen and update your dynamic resource color on button click like below.
private void ButtonClicked(object sender, EventArgs e)
{
Application.Current.Resources["StatusBarColor"] = ((Button)sender).TextColor;
}
C#
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
x:Class="XamarinCommunityToolkit.EffectsSamplePage"
xct:StatusBarEffect.Color="{DynamicResource StatusBarColor}">
<ContentPage.Content>
<StackLayout xct:SafeAreaEffect.SafeArea="True"
BackgroundColor="White">
<Frame BackgroundColor="#2196F3"
Padding="24"
CornerRadius="0">
<Label Text="Xamarin Forms Effects using XCT"
HorizontalTextAlignment="Center"
TextColor="White"
FontSize="36"/>
</Frame>
<Image
x:Name="img"
HeightRequest="150"
Margin="10"
xct:ShadowEffect.Color="Green"
xct:ShadowEffect.OffsetY="15"
Source="https://shorturl.at/qsvJ1">
<Image.Effects>
<xct:LifecycleEffect Loaded="LifeCycleEffect_Loaded" Unloaded="LifeCycleEffect_Unloaded" />
</Image.Effects>
</Image>
<Grid Padding="10">
<Button Clicked="ButtonClicked" Text="Red" TextColor="Red" BorderColor="Red" BorderWidth="2" Grid.Column="0"/>
<Button Clicked="ButtonClicked" Text="Green" TextColor="Green" BorderColor="Green" BorderWidth="2" Grid.Column="1"/>
<Button Clicked="ButtonClicked" Text="Blue" TextColor="Blue" BorderColor="Blue" BorderWidth="2" Grid.Column="2"/>
</Grid>
</StackLayout>
</ContentPage.Content>
</ContentPage>
C#
The XCT offering other type effects as well and please visit the below link for more samples. https://github.com/xamarin/XamarinCommunityToolkit/tree/main/samples/XCT.Sample/Pages/Effects
You can download the code from GitHub. If you have doubt, feel free to post comment. If you like this article and is useful to you, do like, share the article & star the repository on GitHub.
Source: https://www.c-sharpcorner.com/article/xamarin-community-toolkit-effects/
1650410880
En esta publicación, veremos los efectos destacados disponibles en Xamarin Community Toolkit y cómo usarlos. Esta publicación es parte de Xamarin Community Toolkit - Tutorial Series , visite la publicación para obtener información sobre Xamarin Community Toolkit. El kit de herramientas de la comunidad de Xamarin es una colección de elementos reutilizables para el desarrollo móvil con Xamarin.Forms, que incluye animaciones, comportamientos, convertidores, efectos y ayudantes. Simplifica y demuestra las tareas comunes de los desarrolladores al crear aplicaciones para iOS, Android, macOS, WPF y Universal Windows Platform (UWP) con Xamarin.Forms.
Cree un nuevo proyecto seleccionando Nuevo proyecto à Seleccione Xamarin Cross Platform App y haga clic en Aceptar.
Nota: la versión de Xamarin.Forms debe ser superior a 5.0.
Luego, seleccione las plataformas Android e iOS como se muestra a continuación con la estrategia de uso compartido de código como PCL o .Net Standard y haga clic en Aceptar.
En este paso, veremos cómo configurar el complemento.
En este paso, veremos cómo implementar los efectos destacados que se ofrecen en Xamarin Community Toolkit. Aquí, hemos explicado la implementación de Safe Area Effect, Shadow Effect, Life Cycle Effect y StatusBar Effect.
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
C#
Específicamente, ayudará a asegurarse de que las esquinas redondeadas del dispositivo, el indicador de inicio o la carcasa del sensor en un iPhone X no recorten el contenido. El efecto solo se dirige a iOS, lo que significa que en otras plataformas no hace nada.
Propiedades
<StackLayout xct:SafeAreaEffect.SafeArea="True" BackgroundColor="White"> </StackLayout>
C#
Area segura
Indica qué áreas seguras se deben tener en cuenta para este elemento
Antes de aplicar el efecto
Después de aplicar el efecto
Se usa para tener un efecto de sombra para las vistas de Xamarin Forms y tenemos cinco propiedades que deben entenderse para usar este efecto.
Propiedades
En este ejemplo, actualicé el efecto de sombra para el control de imagen como en el siguiente bloque de código
<Image
x:Name="img"
HeightRequest="150"
Margin="10"
xct:ShadowEffect.Color="Green"
xct:ShadowEffect.OffsetY="15"
Source="https://shorturl.at/qsvJ1">
</Image>
C#
LifecycleEffect le permite determinar cuándo la plataforma asigna su renderizador a VisualElement. Se puede identificar mediante los controladores de eventos LifeCycleEffect.
<Image
x:Name="img"
HeightRequest="150"
Margin="10"
Source="https://shorturl.at/qsvJ1">
<Image.Effects>
<xct:LifecycleEffect Loaded="LifeCycleEffect_Loaded" Unloaded="LifeCycleEffect_Unloaded" />
</Image.Effects>
</Image>
C#
private void LifeCycleEffect_Loaded(object sender, EventArgs e)
{
Console.WriteLine("Image loaded...");
}
private void LifeCycleEffect_Unloaded(object sender, EventArgs e)
{
Console.WriteLine("Image Unloaded...");
}
C#
En este ejemplo, crearemos un recurso de color en el archivo App.xaml como se muestra a continuación. Se actualizará más adelante de forma dinámica.
<Color x:Key="StatusBarColor">Firebrick</Color>
C#
Luego agregue la siguiente línea en el elemento raíz de su página XAML como DynamicResource
xct:StatusBarEffect.Color="{DynamicResource StatusBarColor}"
C#
Luego agregue los 3 botones como en la pantalla de muestra y actualice el color de su recurso dinámico al hacer clic en el botón como se muestra a continuación.
private void ButtonClicked(object sender, EventArgs e)
{
Application.Current.Resources["StatusBarColor"] = ((Button)sender).TextColor;
}
C#
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
x:Class="XamarinCommunityToolkit.EffectsSamplePage"
xct:StatusBarEffect.Color="{DynamicResource StatusBarColor}">
<ContentPage.Content>
<StackLayout xct:SafeAreaEffect.SafeArea="True"
BackgroundColor="White">
<Frame BackgroundColor="#2196F3"
Padding="24"
CornerRadius="0">
<Label Text="Xamarin Forms Effects using XCT"
HorizontalTextAlignment="Center"
TextColor="White"
FontSize="36"/>
</Frame>
<Image
x:Name="img"
HeightRequest="150"
Margin="10"
xct:ShadowEffect.Color="Green"
xct:ShadowEffect.OffsetY="15"
Source="https://shorturl.at/qsvJ1">
<Image.Effects>
<xct:LifecycleEffect Loaded="LifeCycleEffect_Loaded" Unloaded="LifeCycleEffect_Unloaded" />
</Image.Effects>
</Image>
<Grid Padding="10">
<Button Clicked="ButtonClicked" Text="Red" TextColor="Red" BorderColor="Red" BorderWidth="2" Grid.Column="0"/>
<Button Clicked="ButtonClicked" Text="Green" TextColor="Green" BorderColor="Green" BorderWidth="2" Grid.Column="1"/>
<Button Clicked="ButtonClicked" Text="Blue" TextColor="Blue" BorderColor="Blue" BorderWidth="2" Grid.Column="2"/>
</Grid>
</StackLayout>
</ContentPage.Content>
</ContentPage>
C#
El XCT también ofrece otros tipos de efectos. Visite el siguiente enlace para obtener más ejemplos. https://github.com/xamarin/XamarinCommunityToolkit/tree/main/samples/XCT.Sample/Pages/Effects
Puedes descargar el código desde GitHub. Si tienes dudas, no dudes en publicar un comentario. Si te gusta este artículo y te resulta útil, haz clic en Me gusta, comparte el artículo y destaca el repositorio en GitHub.
Fuente: https://www.c-sharpcorner.com/article/xamarin-community-toolkit-effects/