0

我在 asp.net 中有这样的中继器

 <asp:Repeater runat="server" ID="rptrExperience" OnItemDataBound = "itembound">
                        <ItemTemplate>
                            <div class="experience">
                               <a><asp:Label ID="Label13" class="accounts-link" runat="server" Text='<%#Eval("JobTitle") %>'></asp:Label></a> <br />
                               <a> <asp:Label ID="Label14" class="accounts-link" runat="server" Text='<%#Eval("Company") %>'></asp:Label></a><br />
                                <%-- <asp:Label ID="Label1" runat="server" Text='<%#Eval("town") %>'></asp:Label><br />
                                <asp:Label ID="Label15" runat="server" Text='<%#Eval("Location") %>'></asp:Label><br />--%>
                                <asp:Label ID="Label16" runat="server" Text='<%#Eval("Period") %>'></asp:Label><br />
                                <asp:Label ID="Label17" runat="server" Text='<%#Eval("Description") %>'></asp:Label><br />
                                <asp:Label ID="lblname" runat="server"></asp:Label>
                                <a id="ae" href="#?w=750" class=" floatleft poplight"  rel="popup6" runat ="server"  >Endorse <asp:Label ID="en" runat="server" Text='<%#Name(Eval("UserId")) %>'></asp:Label>'s Work in <asp:Label ID="en1" runat="server" Text='<%#Eval("Company") %>'></asp:Label></a>
                                <a  id="te" runat="server" rel="tooltip" title="You can endorse your collegue or friend you have worked together.This is your professional opinion so keep it professional.Tip: Keep it clear and simple, Your friend can delete your endorsementif they are innappropriate. "><img src="images/icon-tips.png" width="14" height="15" alt="tips" /></a>
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>

并使用 linq 绑定数据

我希望在 wpf 应用程序中显示相同的内容。我是 wpf 的新手,谁能帮帮我

4

1 回答 1

1

我认为ItemsControl可能会满足您的需求:

<ItemsControl ItemsSource="{Binding ...}">
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <!-- Template goes here ... -->
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>
于 2013-01-16T14:37:44.807 回答