intérieur TestEntryView.xaml.csItemsControl avec ItemSource réglé sur ObservableCollection de UserControls ne parvient pas à rendre dans l'arbre visuel
public partial class TestEntryView : UserControl
{
public ObservableCollection<TestFieldView> Fields {get;set;}
...
}
où TestFieldView est un UserControl.
<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}}">
<Grid Background="{DynamicResource ButtonNormalBorder}" TextElement.Foreground="{DynamicResource TextBrush}">
<Border Background="{DynamicResource ControlBackgroundBrush}" BorderBrush="{DynamicResource ControlBackgroundBrush}" BorderThickness="4" CornerRadius="16">
<Grid Margin="4" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ScrollViewer Background="{DynamicResource ControlBackgroundBrush}" Grid.IsSharedSizeScope="True" Grid.Row="1">
<ItemsControl x:Name="fieldList" ItemsSource="{Binding Fields, ElementName=testEntryView}"/>
</ScrollViewer>
</Grid>
</Border>
</Grid>
La liaison est droite, mais quand je snoop l'arbre visuel mes articles enfants sont tous constitués d'une frontière et présentatrice du contenu, pas de visuels de l'enfant.
Cela a effectivement été le cas! Il y avait une surcharge qui a échoué à l'appeler, je me sens comme un imbécile maintenant! – Firoso