Click here to Skip to main content
16,004,828 members
Home / Discussions / WPF
   

WPF

 
QuestionWhat is DataContext in WPF ? Pin
Mohammad Dayyan23-Jan-10 2:48
Mohammad Dayyan23-Jan-10 2:48 
AnswerRe: What is DataContext in WPF ? Pin
Abhinav S23-Jan-10 3:13
Abhinav S23-Jan-10 3:13 
GeneralRe: What is DataContext in WPF ? Pin
Mohammad Dayyan23-Jan-10 3:55
Mohammad Dayyan23-Jan-10 3:55 
QuestionCross-thread Calls on UI Elements Pin
Richard Andrew x6422-Jan-10 15:58
professionalRichard Andrew x6422-Jan-10 15:58 
AnswerRe: Cross-thread Calls on UI Elements Pin
Eslam Afifi22-Jan-10 23:03
Eslam Afifi22-Jan-10 23:03 
QuestionHow to create a custom display of items in WPF? Pin
darthBug22-Jan-10 8:03
darthBug22-Jan-10 8:03 
AnswerRe: How to create a custom display of items in WPF? Pin
hb5213421422-Jan-10 8:38
hb5213421422-Jan-10 8:38 
QuestionNeed to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII21-Jan-10 17:48
fjparisIII21-Jan-10 17:48 
Given the following xaml:

<ListBox
    Name="listBox"
    BorderThickness="0" 
    SelectionMode="Extended"
    KeyUp="listBox_KeyUp"
    SelectionChanged="listBox_SelectionChanged"
    >
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <WrapPanel
                Name="wrapPanel"
                MinHeight="17"
                Width="444"
                IsItemsHost="True"
                Orientation="Horizontal"
                HorizontalAlignment="Left"
                >
            </WrapPanel>
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
</ListBox>

How do I dynamically size the width of the WrapPanel? The name of the WrapPanel ("wrapPanel") does not seem to be available from code behind. Also, the following code returns null:

Object o = listBox.FindName("wrapPanel");

The following line throws a "file not found" exception:

Object o = listBox.ItemsPanel.FindName("wrapPanel", listBox);

What I want to do is keep the width of the WrapPanel in step with changes to the width of the ListBox. As you can see, right now it's hard-coded as 444, which is the width of the ListBox when the dialog first comes up, but as the user drags the left or right border of the containing resizable window, the ListBox width changes but the WrapPanel is locked at 444. Somehow I need to get ahold of the WrapPanel object.
AnswerRe: Need to dynamically size width of ListBox.ItemsPanel Pin
Gideon Engelberth22-Jan-10 5:33
Gideon Engelberth22-Jan-10 5:33 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 6:52
fjparisIII22-Jan-10 6:52 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
hb5213421422-Jan-10 7:33
hb5213421422-Jan-10 7:33 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 8:43
fjparisIII22-Jan-10 8:43 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
hb5213421422-Jan-10 9:45
hb5213421422-Jan-10 9:45 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 12:32
fjparisIII22-Jan-10 12:32 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
hb5213421422-Jan-10 13:55
hb5213421422-Jan-10 13:55 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 15:31
fjparisIII22-Jan-10 15:31 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
Kasim_Husaini20-Oct-10 20:02
Kasim_Husaini20-Oct-10 20:02 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
Gideon Engelberth22-Jan-10 12:46
Gideon Engelberth22-Jan-10 12:46 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel SOLVED! Pin
fjparisIII22-Jan-10 15:21
fjparisIII22-Jan-10 15:21 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel SOLVED! Pin
Gideon Engelberth22-Jan-10 19:14
Gideon Engelberth22-Jan-10 19:14 
QuestionPage loaded...but debug symbols not loaded? Need help ASAP please! Pin
Michael Eber21-Jan-10 9:03
Michael Eber21-Jan-10 9:03 
AnswerRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Mark Salsbery21-Jan-10 13:52
Mark Salsbery21-Jan-10 13:52 
GeneralRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Michael Eber21-Jan-10 19:05
Michael Eber21-Jan-10 19:05 
AnswerRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Abhinav S21-Jan-10 19:24
Abhinav S21-Jan-10 19:24 
GeneralRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Michael Eber22-Jan-10 12:43
Michael Eber22-Jan-10 12: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.