Skip to content

Instantly share code, notes, and snippets.

@LanceMcCarthy
Created February 19, 2018 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LanceMcCarthy/c44d0f22f71b04776eb9b3aa4037519c to your computer and use it in GitHub Desktop.
Save LanceMcCarthy/c44d0f22f71b04776eb9b3aa4037519c to your computer and use it in GitHub Desktop.
<?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