Skip to content

Commit

Permalink
Merge branch 'Parallax-UG-sample-update' of https://github.com/Syncfu…
Browse files Browse the repository at this point in the history
  • Loading branch information
snehakPV committed Mar 18, 2024
2 parents d034752 + ebf6f73 commit ac7730f
Showing 1 changed file with 21 additions and 40 deletions.
61 changes: 21 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,19 @@ This section explains the steps required to configure the [`SfParallaxView`](htt
3. To initialize the control, import the Parallax View namespace.
4. Initialize [SfParallaxView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.ParallaxView.SfParallaxView.html).

{% tabs %}

{% highlight xaml %}

###### Xaml
```xaml
<ContentPage
. . .
xmlns:parallaxView="clr-namespace:Syncfusion.Maui.ParallaxView;assembly=Syncfusion.Maui.ParallaxView">
<Grid>
<parallaxView:SfParallaxView/>
</Grid>
</ContentPage>

{% endhighlight %}

{% highlight C# %}
```

###### C#
```C#
using Syncfusion.Maui.ParallaxView;
namespace ParallaxViewGettingStarted
{
Expand All @@ -40,17 +37,14 @@ namespace ParallaxViewGettingStarted
}
}
}

{% endhighlight %}

{% endtabs %}
```

## Register the handler

Syncfusion.Maui.Core Nuget is a dependent package for all Syncfusion controls of .NET MAUI. In the MauiProgram.cs file, register the handler for Syncfusion core.

{% highlight C# %}

######
```C#
using Microsoft.Extensions.Logging;
using Syncfusion.Maui.Core.Hosting;

Expand All @@ -73,20 +67,16 @@ namespace ParallaxViewGettingStarted
}
}
}

{% endhighlight %}

```

## Add content to the parallax view

The [`Content`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.ParallaxView.SfParallaxView.html#Syncfusion_Maui_ParallaxView_SfParallaxView_Content) represents the background view of a parallax view. Set any kind of view to the [`Content`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.ParallaxView.SfParallaxView.html#Syncfusion_Maui_ParallaxView_SfParallaxView_Content) property, such as Image and StackLayout.

The following code sample demonstrates how to set the content property to the parallax view.

{% tabs %}

{% highlight xaml %}

###### Xaml
```xaml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:ParallaxViewGettingStarted"
Expand All @@ -104,11 +94,10 @@ The following code sample demonstrates how to set the content property to the pa
</ContentPage.Content>

</ContentPage>
```

{% endhighlight %}

{% highlight c# %}

###### C#
```C#
using Syncfusion.Maui.ParallaxView;

namespace ParallaxViewGettingStarted
Expand All @@ -132,9 +121,7 @@ namespace ParallaxViewGettingStarted
}
}
}

{% endhighlight %}
{% endtabs %}
```

## Bind source to the parallax view

Expand All @@ -147,10 +134,8 @@ Currently, the [SfParallaxView](https://help.syncfusion.com/cr/maui/Syncfusion.M

The following code sample demonstrates how to bind the Syncfusion ListView to the [`Source`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.ParallaxView.SfParallaxView.html#Syncfusion_Maui_ParallaxView_SfParallaxView_Source) property.

{% tabs %}

{% highlight xaml %}

###### Xaml
```xaml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:ParallaxViewGettingStarted"
Expand Down Expand Up @@ -191,11 +176,10 @@ The following code sample demonstrates how to bind the Syncfusion ListView to th
</ContentPage.Content>

</ContentPage>
```

{% endhighlight %}

{% highlight c# %}

###### C#
```C#
public partial class MainPage : ContentPage
{
public MainPage()
Expand Down Expand Up @@ -251,10 +235,7 @@ public class Contacts

public ImageSource ItemImage { get; set; }
}

{% endhighlight %}

{% endtabs %}
```

T> The size of the [`Content`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.ParallaxView.SfParallaxView.html#Syncfusion_Maui_ParallaxView_SfParallaxView_Content) view will automatically be stretched to the size of the [`Source`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.ParallaxView.SfParallaxView.html#Syncfusion_Maui_ParallaxView_SfParallaxView_Source) view.

Expand Down

0 comments on commit ac7730f

Please sign in to comment.