I am trying to create a control with multiple content presenters. So far I just trying to get the first one to work, but to know avail. I created an associated property to bind to but it doesn't work when I test the control. Can anyone assist me in resolving the issue.
<StackPanel HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="Auto" Orientation="Horizontal">
<TextBlock Name="FieldLabel" VerticalAlignment="Top" Width="200" FontSize="14" Height="auto" />
<Button Name="EditButton" Margin="10,0,10,0" VerticalAlignment="Top">
<Image Source="Resources/097-128Edit.png"></Image>
</Button>
<StackPanel>
<StackPanel Name="EditListPanel">
<StackPanel Name="EditListHeaderPanel" Orientation="Horizontal">
<StackPanel>
<ContentPresenter ContentSource="ListHeaderDetail" />
</StackPanel>
<StackPanel Name="EditListHeaderMenuPanel" Orientation="Horizontal">
<Button Name="AddListButton" >
<Image Source="Resources/Add-128.png"></Image>
</Button>
<Button Name="SaveListButton">
<Image Source="Resources/Save-128.png"></Image>
</Button>
<Button Name="ViewListButton">
<Image Source="Resources/Undo.png"></Image>
</Button>
</StackPanel>
</StackPanel>
<StackPanel Name="AddNewPanel" Orientation="Horizontal">
<StackPanel Name="AddNewDetailPanel" Orientation="Horizontal">
<!--<ContentPresenter ContentSource="{Binding Path=AddNewDetail}" />-->
</StackPanel>
<StackPanel Name="AddNewMenuPanel" Orientation="Horizontal">
<Button Name="SaveNewButton">
<Image Source="Resources/Save-128.png"></Image>
</Button>
<Button Name="CancelNewButton">
<Image Source="Resources/Undo.png"></Image>
</Button>
</StackPanel>
</StackPanel>
<StackPanel Name="EditListDetailPanel" Orientation="Horizontal">
<!--<ContentPresenter ContentSource="{Binding Path=EditListDetail}" />-->
</StackPanel>
</StackPanel>
<StackPanel Name="EditTextPanel">
<StackPanel Name="EditTextDetailPanel" Orientation="Horizontal">
<!--<ContentPresenter ContentSource="{Binding Path=EditTextDetail}" />-->
</StackPanel>
<StackPanel Name="EditTextMenuPanel" Orientation="Horizontal">
<Button Name="SaveTextButton">
<Image Source="Resources/Save-128.png"></Image>
</Button>
<Button Name="ViewTextButton">
<Image Source="Resources/Undo.png"></Image>
</Button>
</StackPanel>
</StackPanel>
<StackPanel Name="ViewPanel">
<!--<ContentPresenter ContentSource="{Binding Path=ViewDetail}" />-->
</StackPanel>
</StackPanel>
</StackPanel>
Public Shared ReadOnly ListHeaderDetailProperty As DependencyProperty = DependencyProperty.Register("ListHeaderDetail", GetType(Object), GetType(FieldManagerControl), New PropertyMetadata(Nothing)) Public Property ListHeaderDetail() As Object Get Return GetValue(ListHeaderDetailProperty) End Get Set(value As Object) SetValue(ListHeaderDetailProperty, value) End Set End Property