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;
}
}
}
}



- UWP - How to use TextBox SelectionChanged event
- UWP - How to use TextBox TextChanged event
- UWP - TextBox ScrollBar example
- UWP - SymbolIcon example
- UWP - How to add a new line to a TextBlock
- UWP - ListView alternate item style
- UWP - How to create a ListView programmatically
- UWP - How to use RadioButton
- UWP - ToggleSwitch example
- UWP - Hyperlink text element example
- UWP - Show image and text on a Button
- UWP - Simple MessageDialog example
- UWP - Remove control programmatically
- UWP - CheckBox group example
- UWP - Button click event