It seems like this should be simple...
I have a usercontrol that I am going to use on several tabs of a tab control. I want all instances of the usercontrol to be synchronized.
In my usercontrol I have a list of strings:
public static List<string> fonts = new List<string>() { "Arial", "Courier" };
And a ListBox:
<ListBox x:Name="fontList" ItemsSource="{Binding Path=fonts}" />
However, the listbox is never populated.
In searching for example code, it seems like I have seen this implementation in several samples, but I can't get it to work.
Thanks for any hints...
Updated with AWJ's suggestions, but still not working:
MainPage.xaml.cs:
public partial class MainPage : UserControl
{
public static List<string> _fonts
= new List<string>() { "Arial", "Courier" };
public List<string> Fonts { get { return _fonts; } }
}
In TestGroup.xaml:
<ListBox x:Name="fontList1" ItemsSource="{Binding Parent.Fonts, ElementName=LayoutRoot}" Margin="3" />