English 中文(简体)
WP7 - 在名单框内列入某一个插图时查阅该清单中的某些项目
原标题:WP7 - accessing selected item in listbox when listbox is within an itemtemplate

我有一个Pivot项目模板,其中包括一个清单箱。

 <controls:Pivot x:Name="MainPivot" ItemsSource="{Binding PivotItemHeaders}" Title="CLASS TIMETABLE"  >
        <controls:Pivot.HeaderTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Description}"/>
            </DataTemplate>
        </controls:Pivot.HeaderTemplate>
        <controls:Pivot.ItemTemplate>
            <DataTemplate>
                <ListBox x:Name="Events" ItemsSource="{Binding allEventItems}" ItemTemplate="{StaticResource EventDisplay2}"/>
            </DataTemplate>
        </controls:Pivot.ItemTemplate>
    </controls:Pivot>

在我后面的代码中,我想查阅该名单箱的选定系统,但我无法进入名单箱,因为模板中的正直(推定)是这样。

i.e

this.NavigationService.Navigate(new Uri("/View/EventEdit.xaml?selectedEvent=" +  Events.SelectedItem, UriKind.Relative));

活动清单箱没有得到承认。

假定我可以把物体通过作为参数通过,我可以用来检索。

I know its starts with protected override void OnNavigatedTo(NavigationEventArgs e) { if (NavigationContext.QueryString.ContainsKey("SelectedEvent")) {

但我不赞成从参数中提取物体的辛醇/编码。

赞赏我如何能够从这一清单箱和法典中抽取选定的系统,使物体通过

  • thanks
最佳回答
问题回答

暂无回答




相关问题
WPF: How to limit number of rows shown by ListBox?

Is it possible to limit the number of rows a listbox show? Eg. let´s say I have a ItemSource with 100 items, but I only want my listbox to be 10 items high.

ListBox Value containing links

hi I am currently working on improving the SEO on a website containing dropdown list menu. currently when you select options and then submit a javascript is redirecting you to the next page I heard ...

asp.net listbox double click event + event handler

I am trying to add a double-click event in a listbox. But I am getting the following error. the aspx file <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListBox__Test.aspx.cs" ...

How to insert ComboBox item into ListBox? [winforms]

The question is very simple, How to insert ComboBox selected item into ListBox using c#? I have tried with this: listbox.Items.Add(combobox.SelectedItem); and some other permutations but it always ...

listbox itemtemplate for selected item

I am using Listbox with ItemTemplate, and when I select an item from the list, it shows blue background How can I style the selected item, to be similar to non-selected one?

WPF Data Binding Error in ListBox

I have a ListBox: <ListBox x:Name="HistogramListBox" Grid.Column="1" Margin="8,2,8,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Template="{StaticResource ...

How do I anchor an expander to right side of a ListBox?

The XAML code below works fine except I want the expander button to be between the listbox and the grid. If I set the ExpandDirection="Left" the button is between the listbox and the grid but the ...

Adding Items to ListBox, RadioList, Combobox using reflection

I m trying to add items to a listbox,combobox, radiolist using reflection. The code I have at the moment is as follows: public static Control ConfigureControl(Control control, ControlConfig ctrlconf)...

热门标签