1

在这里,我想将 accountview.xaml 添加到 accountlistview.xaml 中。我尝试了很多选项,但我做不到。这里 accountlistview.xaml 包含网格,accountview.xaml 包含文本框。accountlistview.xaml 的代码

<UserControl x:Class="MyBooks.View.accountListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vw="clr-namespace:MyBooks.View"
xmlns:uic="clr-namespace:UIControls;assembly=UIControls"
xmlns:wpftoolkit="http://schemas.microsoft.com/wpf/2008/toolkit">

<UserControl.Resources>
    <ResourceDictionary Source="ViewResources.xaml" />
</UserControl.Resources>

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>
        <ColumnDefinition  Width="*"/>
        <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions><wpftoolkit:DataGrid Grid.Row="1"
                         ItemsSource="{Binding Payments}"
                         SelectedItem="{Binding SelectedPayment, Mode=TwoWay}"
                         AutoGenerateColumns="False"
                         SelectionMode="Single"
                         IsReadOnly="True">
        <wpftoolkit:DataGrid.Columns>
            <wpftoolkit:DataGridTextColumn
                Header="{Resx ResxName=MyBooks.Properties.Strings, Key=Journal_Date_Label}"
                Binding="{Binding Date}"/>
            <wpftoolkit:DataGridTextColumn
                Header="{Resx ResxName=MyBooks.Properties.Strings, Key=Journal_CreditedParty_Label}"
                Binding="{Binding CreditedAccount.Name}"/>
            <wpftoolkit:DataGridTextColumn
                Header="{Resx ResxName=MyBooks.Properties.Strings, Key=Journal_Narration_Label}"
                Binding="{Binding Narration}"/>
        </wpftoolkit:DataGrid.Columns>
    </wpftoolkit:DataGrid>

如何在此窗口中添加 accountview.xaml?

4

1 回答 1

1

只需在中包含以下行AccountListView.xaml

<uic:AccountView.xaml />
于 2012-04-26T08:21:32.613 回答