I have a Windows Phone 8.1 app in which I have two pages. First is the MainPage.xaml in which I am using a longlistselector control to show a list. On the Settings.xaml page, I have a font size selection for the user using the Listpicker control.
The question is, once the user selects a new font size on the Settings page, I want to change the font in the longlistselector on MainPage. However, a longlistselector decaled on the MainPage.xaml is not available on the Settings page. (I am setting the itemssource of the longlistselector in the MainPage.cs file.)
How should I resolve this issue? Should I use a page event of MainPage.xaml and detect if a font size has been changed by the user? What is the standard way of tackling this problem?
XAML in Settings.xaml:
<TextBlock Text="Select Font" Margin="0,0,0,0"/>
<toolkit:ListPicker Name="fontlistpicker" Tap="fonttapped" Margin="0,35,0,0" Grid.Row="0" SelectionChanged="fontlistpicker_SelectionChanged">
<toolkit:ListPickerItem x:Name="Font1" Content="10"/>
<toolkit:ListPickerItem x:Name="Font2" Content="20"/>
<toolkit:ListPickerItem x:Name="Font3" Content="30"/>
<toolkit:ListPickerItem x:Name="Font4" Content="40"/>
<toolkit:ListPickerItem x:Name="Font5" Content="50"/>
</toolkit:ListPicker>
XAML in MainPage.xaml:
<phone:LongListSelector Name="myList" >
<phone:LongListSelector.ListHeader>
<TextBlock Name ="dailyHeader" Margin="0,0,0,10" HorizontalAlignment="Center"/>
</phone:LongListSelector.ListHeader>
</phone:LongListSelector>