SevenDays
SevenDays

Reputation: 3768

Accessing static resource listbox by name

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-comments 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

Upvotes: 1

Views: 162

Answers (1)

Egor
Egor

Reputation: 1660

Try Application.Current.Resource["comm_box"]

Upvotes: 1

Related Questions