Click here to Skip to main content
15,880,405 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: ListBoxItem DataTemplate with HyperLink Problem Pin
Kevin Marois9-May-23 5:29
professionalKevin Marois9-May-23 5:29 
QuestionCustomControl Styling Question Pin
Kevin Marois4-May-23 17:22
professionalKevin Marois4-May-23 17:22 
AnswerRe: CustomControl Styling Question Pin
Pete O'Hanlon4-May-23 20:29
mvePete O'Hanlon4-May-23 20:29 
QuestionNavigationControl - Continued Pin
Kevin Marois2-May-23 14:49
professionalKevin Marois2-May-23 14:49 
AnswerRe: NavigationControl - Continued Pin
Richard Deeming2-May-23 22:19
mveRichard Deeming2-May-23 22:19 
GeneralRe: NavigationControl - Continued Pin
Kevin Marois3-May-23 5:21
professionalKevin Marois3-May-23 5:21 
GeneralRe: NavigationControl - Continued Pin
Kevin Marois3-May-23 15:10
professionalKevin Marois3-May-23 15:10 
GeneralRe: NavigationControl - Continued Pin
Richard Deeming3-May-23 21:35
mveRichard Deeming3-May-23 21:35 
The problem is you have two instances of the NavigationPane for each expander - one that you create through code and add to the ContainerItems property, and one that's declared in XAML.

You don't have a binding for the NavigationPaneModel property in the XAML, so that property doesn't propagate from the ContainerItems instance to the XAML instance.

If you add a binding, then the property won't be null:
XAML
<ctrls:NavigationPane BorderBrush="Orange" 
                      BorderThickness="3"
                      Background="Red"
                      NavigationPaneModel="{Binding NavigationPaneModel}"
                      Header="{Binding Header}"
                      Items="{Binding Items}"
                      Margin="0,0,0,1"/>

Alternatively, remove the ListBox.ItemTemplate so that the list displays the items created in code. You can use a style to set the additional properties:
XAML
<!--CONTAINER PANES-->
<ListBox Grid.Row="1"
         Margin="1"
         BorderThickness="1"
         HorizontalContentAlignment="Stretch"
         ItemsSource="{Binding ContainerItems, RelativeSource={RelativeSource TemplatedParent}}"
         ScrollViewer.HorizontalScrollBarVisibility="Auto"
         ScrollViewer.VerticalScrollBarVisibility="Auto">
	
	<ListBox.Resources>
		<Style TargetType="ctrls:NavigationPane">
			<Setter Property="BorderBrush" Value="Orange" />
			<Setter Property="BorderThickness" Value="3" />
			<Setter Property="Background" Value="Red" />
			<Setter Property="Margin" Value="0,0,0,1" />
		</Style>
	</ListBox.Resources>

    <!--
    <ListBox.ItemTemplate>
        <DataTemplate>
            <ctrls:NavigationPane BorderBrush="Orange" 
                                  BorderThickness="3"
                                  Background="Red"
								  NavigationPaneModel="{Binding NavigationPaneModel}"
                                  Header="{Binding Header}"
                                  Items="{Binding Items}"
                                  Margin="0,0,0,1"/>
        </DataTemplate>
    </ListBox.ItemTemplate>
    -->
</ListBox>




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

QuestionWPF 3D rendering Pin
Kenneth Haugland1-May-23 4:52
mvaKenneth Haugland1-May-23 4:52 
AnswerRe: WPF 3D rendering Pin
Gerry Schmitz2-May-23 6:14
mveGerry Schmitz2-May-23 6:14 
GeneralRe: WPF 3D rendering Pin
Kenneth Haugland2-May-23 9:59
mvaKenneth Haugland2-May-23 9:59 
AnswerRe: WPF 3D rendering Pin
RedDk2-May-23 8:03
RedDk2-May-23 8:03 
GeneralRe: WPF 3D rendering Pin
Kenneth Haugland2-May-23 10:01
mvaKenneth Haugland2-May-23 10:01 
QuestionExpander in ListBoxItem Width Problem Pin
Kevin Marois27-Apr-23 7:19
professionalKevin Marois27-Apr-23 7:19 
AnswerRe: Expander in ListBoxItem Width Problem Pin
Richard Deeming1-May-23 23:09
mveRichard Deeming1-May-23 23:09 
GeneralRe: Expander in ListBoxItem Width Problem Pin
Kevin Marois2-May-23 7:12
professionalKevin Marois2-May-23 7:12 
QuestionSpinning Indicator Control Error Pin
Kevin Marois26-Apr-23 14:32
professionalKevin Marois26-Apr-23 14:32 
AnswerRe: Spinning Indicator Control Error Pin
Gerry Schmitz27-Apr-23 7:01
mveGerry Schmitz27-Apr-23 7:01 
GeneralRe: Spinning Indicator Control Error Pin
Kevin Marois27-Apr-23 7:27
professionalKevin Marois27-Apr-23 7:27 
GeneralRe: Spinning Indicator Control Error Pin
Gerry Schmitz28-Apr-23 4:46
mveGerry Schmitz28-Apr-23 4:46 
GeneralRe: Spinning Indicator Control Error Pin
Kevin Marois28-Apr-23 7:24
professionalKevin Marois28-Apr-23 7:24 
QuestionFlat Button Style Problem Pin
Kevin Marois22-Apr-23 18:14
professionalKevin Marois22-Apr-23 18:14 
AnswerRe: Flat Button Style Problem Pin
Gerry Schmitz23-Apr-23 8:55
mveGerry Schmitz23-Apr-23 8:55 
GeneralRe: Flat Button Style Problem Pin
Kevin Marois23-Apr-23 9:15
professionalKevin Marois23-Apr-23 9:15 
GeneralRe: Flat Button Style Problem Pin
Gerry Schmitz23-Apr-23 15:28
mveGerry Schmitz23-Apr-23 15:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.