When starting the WPF project, the saved devices load correctly, and display properly in the collapsible containers.
My task was to turn this into a service. To allow UI access, I created a tray app, which can call the WPF application. These are in two separate projects in the same solution (if that makes a difference). Currently, I have not changed any code in the WPF application, just the startup project. The issue that I have is that the Sender list and Receiver list don't seem to be bound properly to the collapsible containers when loading from the tray. I just get an empty container. I've included the image below to help describe what I mean.

I know the Senders and Receivers are being properly loaded from observing the Load method, and they show up in a different part of the application (see above). I have revved up my reporting, and notice that I get several Information messages saying that the WPF "Cannot retrieve value using the binding...", but research has shown that this is normal as Information, and should only cause concern if there is a Warming. I've included a sample of them below just in case I am mistaken, and they can be helpful.
System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=ReceiversList; DataItem=null; target element is 'RepeatControl' (Name=''); target property is 'List' (type 'IList') System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=DataContext; DataItem=null; target element is 'ContentPresenter' (Name=''); target property is 'DataContext' (type 'Object') System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=CollapsedContent; DataItem=null; target element is 'ContentPresenter' (Name='PART_CollapsedContentPresenter'); target property is 'Content' (type 'Object')
I seem to get these when setting the WPF as startup as well, which confirms that they are probably not related.
I've also included a brief sampling of the xaml below. I've tried to keep it relative to the issue, and have cut out quite a bit to keep the listing a reasonable length.
<UserControl.Resources>
<DataTemplate x:Key="SenderSummary">
<Border BorderThickness="1" BorderBrush="LightGray" CornerRadius="5" Padding="10" Width="720" Margin="10,1,3,0" >
<WrapPanel Orientation="Horizontal" MaxWidth="750" Margin="10,0,0,0">
<TextBlock Name="appinfo"> ...
<DataTemplate x:Key="SenderTemplate" DataType="{x:Type m:SenderReceiverManager}" >
<c:CollapsibleSection Header="{Binding Path=ApplicationName}" Width="750">
<c:CollapsibleSection.CollapsedContent>
<ContentPresenter Content="{Binding}" ContentTemplate="{StaticResource SenderSummary}" Margin="0,1,0,0" Width="750"/>
</c:CollapsibleSection.CollapsedContent>
<Grid MinWidth="710" Margin="20,0,0,0 " > ...
<c:CollapsibleSection Header="Senders">
<c:CollapsibleSection.CollapsedContent>
<c:RepeatControl Margin="30,0,0,0" ItemsSource="{Binding SendersList}"
ItemType="{x:Type m:Sender}" List="{Binding SendersList}"
ItemTemplate="{StaticResource SenderSummary}"/>
</c:CollapsibleSection.CollapsedContent>
<Border BorderThickness="1" BorderBrush="Chocolate" Margin="30,0,0,0">
<c:RepeatControl ItemsSource="{Binding SendersList}" ItemType="{x:Type m:Sender}" List="{Binding SendersList}" ItemTemplate="{StaticResource SenderTemplate}"/>
</Border>
</c:CollapsibleSection>
Any insights on what I might be doing wrong would be extremely appreciated. I have not worked with WPF before, and am finding it difficult to debug the xaml. Thank you all in advance!

New Topic/Question
Reply



MultiQuote




|