2
看起来这应该是简单的...
我有一个用户控件,我将在选项卡控件的多个选项卡上使用。我想要同步usercontrol的所有实例。简单的silverlight数据绑定列表框<>
在我的用户我有一个字符串列表:
按钮和列表框:
<ListBox x:Name="fontList" ItemsSource="{Binding Path=fonts}" />
但是,列表框是永远不会填充。
在搜索示例代码中,似乎我已经在几个示例中看到了这个实现,但是我无法使其工作。
感谢您的任何提示...
更新与磨料水射流的建议,但仍然没有工作:
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; } }
}
在TestGroup.xaml:
<ListBox x:Name="fontList1" ItemsSource="{Binding Parent.Fonts, ElementName=LayoutRoot}" Margin="3" />