I am not sure if I understood your problem right but the simplest way to implement master/detail grid views with csla collections and without code behind is like this:
<Window x:Class="WpfMasterDetail.Window1"
xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
xmlns:tk=http://schemas.microsoft.com/wpf/2008/toolkit
xmlns:MyData="clr-namespace:MyData.DataAccess;assembly=MyData.DataAccess"
xmlns:csla="clr-namespace:Csla.Wpf;assembly=Csla"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<csla:CslaDataProvider x:Key="MasterCollectionProvider"
FactoryMethod="GetAll"
ObjectType="{x:Type MyData:MyMasterCollectionSet}"
IsInitialLoadEnabled="True"
ManageObjectLifetime="True"/>
</Window.Resources>
<Grid DataContext="{Binding Source={StaticResource MasterCollectionProvider}}">
<StackPanel>
<tk:DataGrid IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding}"
AutoGenerateColumns="True"/>
<tk:DataGrid IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Path=CurrentItem.BuchungSet_By_KontoID}"
AutoGenerateColumns="True"/>
</StackPanel>
</Grid>
</Window>
Regards,
Andreas
PS:
CurrentItem must not be a property of your BO. It is a property of the ICollectionView interface which wpf uses internaly to wrap your data source.
Sorry...please replace "CurrentItem.BuchungSet_By_KontoID" with "CurrentItem.MyDetailsCollectionSet" where MyDetailsCollection must be a property of MyMasterCollectionSet
Copyright (c) Marimer LLC