开发者

Accessing static resource listbox by name

开发者 https://www.devze.com 2023-03-23 00:31 出处:网络
App.xaml <Application.Resources> . . . . <StackPanel> <ItemsPresenter/> <ListBox x:Name=\"comm_box\" ItemsSource=\"{Binding}\">
App.xaml
<Application.Resources>
. . . .
<StackPanel>
<ItemsPresenter/>
<ListBox x:Name="comm_box" ItemsSource="{Binding}">
. .. .
</Application.Resources>

error: comm_box doesn't exist in current context

How to resolve this problem? I have listbox-news and listbox-comm开发者_StackOverflow中文版ents that shows after listbox-news But I can't set comm_box.Itemssource because comm_box is invisible. Please help me. http://pastebin.com/DERdgHJ9


Try Application.Current.Resource["comm_box"]

0

精彩评论

暂无评论...
验证码 换一张
取 消