Cyclic reference when using child user control with DataContext binding on the Parent Control
Posted: 19 Nov 2018, 10:53
Hi,
Noesis C++ 2.1.0f1 - 2.2.0b3
if use DataContext = "{Binding ElementName = window}" then when you destroy a window, mView.Reset () does not call WindowCaption () destructor and you cannot destroy Window () because of NumRefCounts > 1
Noesis C++ 2.1.0f1 - 2.2.0b3
Code: Select all
simplified XAML for Window:
<Window x:Class="TrackEditor"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="#303033" Height="300" Width="900"
Title="Track editor" x:Name="window" IsEnableWindowButtons="True">
<Grid>
<!--UserControl.-->
<WindowCaption Height="30" VerticalAlignment="Top" Background="#01000000" Margin="1,1,30,1" DataContext="{Binding ElementName=window}">
</WindowCaption>
</Grid>
</Window>