Note that there are some explanatory texts on larger screens.

plurals
  1. POItemsControl with ItemSource set to ObservableCollection of UserControls fails to render in visual tree
    primarykey
    data
    text
    <p>inside TestEntryView.xaml.cs</p> <pre><code>public partial class TestEntryView : UserControl { public ObservableCollection&lt;TestFieldView&gt; Fields {get;set;} ... } </code></pre> <p>where TestFieldView is a UserControl.</p> <pre><code>&lt;UserControl x:Class="STS2Editor.View.TestEntryView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:vw="clr-namespace:STS2Editor.View" mc:Ignorable="d" x:Name="testEntryView" d:DesignHeight="300" d:DesignWidth="427" d:DataContext="{Binding TestEntry, Source={StaticResource Sample}}"&gt; &lt;Grid Background="{DynamicResource ButtonNormalBorder}" TextElement.Foreground="{DynamicResource TextBrush}"&gt; &lt;Border Background="{DynamicResource ControlBackgroundBrush}" BorderBrush="{DynamicResource ControlBackgroundBrush}" BorderThickness="4" CornerRadius="16"&gt; &lt;Grid Margin="4" &gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;RowDefinition Height="*"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;ScrollViewer Background="{DynamicResource ControlBackgroundBrush}" Grid.IsSharedSizeScope="True" Grid.Row="1"&gt; &lt;ItemsControl x:Name="fieldList" ItemsSource="{Binding Fields, ElementName=testEntryView}"/&gt; &lt;/ScrollViewer&gt; &lt;/Grid&gt; &lt;/Border&gt; &lt;/Grid&gt; </code></pre> <p></p> <p>The binding is right, but when I snoop the visual tree my child items all consist of a border and content presenter, no child visuals.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload