
Hello,
is it possible to use ResizableContentControl as resources for PopupButton.PopupContent for more than one PopupButton ? The following example fails with the exception:
'Set property 'ActiproSoftware.Windows.Controls.PopupButton.PopupContent' threw an exception.' Line number '22' and line position '64'."
"Specified element is already the logical child of another element. Disconnect it first."
Thank you,
Daniel Barta
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
Title="MainWindow" Height="100" Width="100">
<Grid>
<Grid.Resources>
<shared:ResizableContentControl CanAutoSize="True" ResizeMode="None" BorderThickness="1" x:Key="popupContent">
<TextBlock>Test</TextBlock>
</shared:ResizableContentControl>
</Grid.Resources>
<shared:PopupButton x:Name="popup1" Grid.Column="0" Grid.Row="0" Margin="2" DisplayMode="PopupOnly" StaysOpen="False" MinHeight="16"
Background="LightGray" AutomationProperties.AutomationId="ColorPickerEditor.PopupButton"
HorizontalAlignment="Left" VerticalAlignment="Top" Width="16" Height="20"
PopupContent="{StaticResource popupContent}">
</shared:PopupButton>
<shared:PopupButton x:Name="popup2" Grid.Column="1" Grid.Row="0" Margin="2" DisplayMode="PopupOnly" StaysOpen="False" MinHeight="16"
Background="LightGray" AutomationProperties.AutomationId="ColorPickerEditor.PopupButton" HorizontalAlignment="Right"
VerticalAlignment="Top" Width="16" Height="20"
PopupContent="{StaticResource popupContent}">
</shared:PopupButton>
</Grid>
</Window>