UWP - Slider example

MainPage.xaml

<Page
    x:Class="UniversalAppTutorials.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UniversalAppTutorials"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <StackPanel 
        x:Name="stack_panel1" 
        Margin="50" 
        Orientation="Vertical"
        Background="PaleVioletRed"
        Padding="35"
        >
        <TextBlock
            x:Name="text_block1"
            Text="Darg the slider thumb to change this text size."
            TextWrapping="Wrap"
            />
        <Slider
            x:Name="slider1"
            Maximum="45"
            Minimum="25"
            TickFrequency="5"
            TickPlacement="BottomRight"
            ValueChanged="Slider1_ValueChanged"
            Orientation="Horizontal"
            />
    </StackPanel>
</Page>
MainPage.xaml.cs

using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;

namespace UniversalAppTutorials
{
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }

        private void Slider1_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) {
            // Get the slider instance
            Slider slider = sender as Slider;

            if (slider != null) {
                // Set the text block text size as slider value
                text_block1.FontSize = slider.Value;
            }
        }
    }
}