Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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:dataControls="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls"
xmlns:input="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
x:Class="TelerikXamarinApp1.Portable.StartPage">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<input:RadSegmentedControl x:Name="MySegmentControl"
StyleClass="TelerikTheme"
SelectionChanged="SegmentControl_OnSelectionChanged"
HeightRequest="60"/>
<dataControls:RadListView x:Name="MyListView"
StyleClass="TelerikTheme"
Grid.Row="1" />
</Grid>
</ContentPage>
using System.Collections.Generic;
using Telerik.XamarinForms.Common;
using TelerikXamarinApp1.Portable.Themes;
using Xamarin.Forms;
namespace TelerikXamarinApp1.Portable
{
public partial class StartPage : ContentPage
{
public StartPage()
{
InitializeComponent();
MySegmentControl.ItemsSource = new List<string>
{
"Default",
"TelerikBlue",
"Custom"
};
MyListView.ItemsSource = new List<string>
{
"Freda Curtis",
"Jeffery Francis",
"Eva Lawson",
"Emmett Santos",
"Theresa Bryan",
"Jenny Fuller",
"Terrell Norris",
"Eric Wheeler",
"Julius Clayton",
"Alfredo Thornton",
"Roberto Romero",
"Orlando Mathis",
"Eduardo Thomas",
"Harry Douglas",
"Parker Blanton",
"Leanne Motton",
"Shanti Osborn",
"Merry Lasker",
"Jess Doyon"
};
}
private void SegmentControl_OnSelectionChanged(object sender, ValueChangedEventArgs<int> e)
{
switch (e.NewValue)
{
case 1:
ThemeHelper.ChangeTheme("TelerikBlue");
break;
case 2:
ThemeHelper.ChangeTheme("Custom");
break;
default:
ThemeHelper.ChangeTheme("Default");
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.