Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I am working on a windows store app using c# and XAML. I want people to be able to change the text size in my "settings" menu all across the application (on several pages). So far I have found a solution, but it only works with the current TextBlock that I have bound to a slider.

I can change the font size of a single textblock in XAML like this: With a simple textblock using a binding on fontsize bound to the slider:
XML
<TextBlock x:Name="TextBox1" HorizontalAlignment="Left" TextWrapping="Wrap" Text="Change my font size." VerticalAlignment="Top" Height="277" Width="430" FontSize="{Binding Value, ElementName=TextSlider}"/>

<Slider x:Name="TextSlider" HorizontalAlignment="Left" Margin="160,113,0,0" VerticalAlignment="Top" Width="100" Value="14" Minimum="1" Maximum="42" />


What I want to do is to bind the font size of all my TextBlock's to a single slider at my settings page. So when you slide the slider, the size of the text changes accordingly to the value of the slider on all pages.
Thank you, I would appreciate any tips on how to do this :)
Posted
Comments
Member 10899112 2-Jul-14 6:20am    
I have already changed some stuff in app.xaml, but I can't make data bindings there to the slider

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900