Click here to Skip to main content
15,889,736 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Path in Style Question Pin
Gerry Schmitz12-Apr-23 7:01
mveGerry Schmitz12-Apr-23 7:01 
GeneralRe: Path in Style Question Pin
Kevin Marois12-Apr-23 7:06
professionalKevin Marois12-Apr-23 7:06 
GeneralRe: Path in Style Question Pin
Kevin Marois18-Apr-23 14:45
professionalKevin Marois18-Apr-23 14:45 
QuestionDraw Images Pin
Kevin Marois4-Apr-23 14:24
professionalKevin Marois4-Apr-23 14:24 
AnswerRe: Draw Images Pin
Andy_L_J5-Apr-23 1:41
Andy_L_J5-Apr-23 1:41 
AnswerRe: Draw Images Pin
Pete O'Hanlon5-Apr-23 2:27
mvePete O'Hanlon5-Apr-23 2:27 
GeneralRe: Draw Images Pin
Kevin Marois7-Apr-23 6:31
professionalKevin Marois7-Apr-23 6:31 
GeneralRe: Draw Images Pin
Pete O'Hanlon13-Apr-23 21:41
mvePete O'Hanlon13-Apr-23 21:41 
QuestionJson Based Themes Pin
Kevin Marois6-Mar-23 6:39
professionalKevin Marois6-Mar-23 6:39 
QuestionDropDown TreeView Pin
Kevin Marois22-Feb-23 18:34
professionalKevin Marois22-Feb-23 18:34 
AnswerRe: DropDown TreeView Pin
Gerry Schmitz24-Feb-23 9:08
mveGerry Schmitz24-Feb-23 9:08 
GeneralRe: DropDown TreeView Pin
Kevin Marois2-Mar-23 11:30
professionalKevin Marois2-Mar-23 11:30 
GeneralRe: DropDown TreeView Pin
Gerry Schmitz3-Mar-23 5:25
mveGerry Schmitz3-Mar-23 5:25 
QuestionStyles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma22-Feb-23 1:50
Simos Sigma22-Feb-23 1:50 
Rant[REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Richard Deeming22-Feb-23 3:51
mveRichard Deeming22-Feb-23 3:51 
GeneralRe: [REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma22-Feb-23 22:16
Simos Sigma22-Feb-23 22:16 
GeneralRe: [REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma22-Feb-23 23:46
Simos Sigma22-Feb-23 23:46 
GeneralRe: [REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma23-Feb-23 0:55
Simos Sigma23-Feb-23 0:55 
QuestionWPF .Net Core 6 RelayCommand Problem Pin
Kevin Marois3-Feb-23 12:33
professionalKevin Marois3-Feb-23 12:33 
AnswerRe: WPF .Net Core 6 RelayCommand Problem Pin
Richard Deeming5-Feb-23 23:18
mveRichard Deeming5-Feb-23 23:18 
Questionhow to set the icon for output result(.exe) in vs2022 ? Pin
Member 136170031-Feb-23 14:56
Member 136170031-Feb-23 14:56 
AnswerRe: how to set the icon for output result(.exe) in vs2022 ? Pin
Richard MacCutchan1-Feb-23 21:12
mveRichard MacCutchan1-Feb-23 21:12 
GeneralRe: how to set the icon for output result(.exe) in vs2022 ? Pin
Member 136170032-Feb-23 13:43
Member 136170032-Feb-23 13:43 
QuestionExpander Width Problem Pin
Kevin Marois13-Jan-23 13:01
professionalKevin Marois13-Jan-23 13:01 
I'm trying to create a ListBox, with it's ItemTemplate being an expander, which itself has a list in it.

Here's a pic of what I'm trying to accomplish. Pic
I added colors around each item to highlight what's happening.

Here's the XAML
<ListBox Grid.Row="2"
            Grid.Column="1"
            x:Name="outerList"
            Margin="2,2,2,2"
            Background="Transparent"
            ItemsSource="{Binding RecentItemSections}"
            SelectedItem="{Binding SelectedRecentItemSection}"
            HorizontalAlignment="Stretch"
            BorderBrush="Yellow"
            BorderThickness="2">

    <ListBox.ItemTemplate>

        <DataTemplate>

            <Expander IsExpanded="{Binding IsSectionExpanded}"
                        x:Name="expander"
                        HorizontalAlignment="Stretch"
                        BorderBrush="Red"
                        BorderThickness="2">

                <Expander.Header>
                    <TextBlock Text="{Binding SectionName}"
                                Foreground="White" 
                                Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
                                    AncestorType={x:Type ListBoxItem}}, Path=ActualWidth}"/>
                </Expander.Header>

                <ListBox ItemsSource="{Binding RecentItems}"
                            BorderBrush="Green"
                            BorderThickness="5"
                            Margin="2,0,20,0">

                    <ListBox.ItemTemplate>
                        <DataTemplate>

                            <Border BorderBrush="MediumAquamarine"
                                    BorderThickness="2">

                                <StackPanel Orientation="Vertical"
                                        HorizontalAlignment="Stretch">

                                    <TextBlock Text="{Binding ItemName}"
                                            FontSize="12"
                                            Margin="2"/>

                                    <TextBlock Text="{Binding ItemLocation}"
                                            FontSize="10"
                                            Margin="2,0,2,2"/>

                                </StackPanel>

                            </Border>

                        </DataTemplate>
                    </ListBox.ItemTemplate>

                </ListBox>

            </Expander>

        </DataTemplate>

    </ListBox.ItemTemplate>

</ListBox>
As you can see in the pic, the Expander's header is off the right side of the listbox item.

How can I get the expander to fit inside its parent, the ListBox?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: Expander Width Problem Pin
Gerry Schmitz14-Jan-23 5:43
mveGerry Schmitz14-Jan-23 5:43 

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.