New to Telerik UI for Xamarin? Download free 30-day trial

RadSlideView Access Parent BindingContext in Slide


Product Version 2018.3.1122.3
Product SlideView for Xamarin.Forms


The RadSlideView uses ContentView for the slides, these ContentViews do not have scope to BindingContext of the visual parents (e.g. the SlideView or parent page). This has the consequence of not being able to bind any ContentView content to a page view model.


You can solve this by using a static helper class to share a BindingContext reference. The static class only needs one public static object property:

Example Helper Class

public static class BindingContextHelper
    public static object CurrentPageBindingContext { get; set; }

Example Use

When the RadSlideView parent's BindingContext is set, you can set the helper class's property. In this example, we'll use a ContentPage.


public class MyItem
    public string ItemName { get; set; }


public class ViewModel
    public ViewModel()

    public ObservableCollection<MyItem> MyItems { get; set; } = new ObservableCollection<MyItem>
        new MyItem {ItemName = "Item One"}

    public Command MyViewModelCommand { get; set; } = new Command(() =>
            Debug.WriteLine("You have invoked a command in the view model!");


<telerikPrimitives:RadSlideView ItemsSource="{Binding MyItems}">
        <StackLayout >
          <Label Text="{Binding ItemName}" />
          <Button BindingContext="{x:Static helpers:BindingContextHelper.CurrentPageBindingContext}"
                  Command="{Binding MyViewModelCommand}" />
public partial class MainPage : ContentPage
    public MainPage()

        // Set the parent's BindingContext
        this.BindingContext = new ViewModel();

        // Pass that BindingContext to the helper class
        BindingContextHelper.CurrentPageBindingContext = this.BindingContext;
In this article