Click here to Skip to main content
15,887,135 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF / MVVM - Modular Design Question Pin
Kevin Marois11-Mar-13 8:39
professionalKevin Marois11-Mar-13 8:39 
GeneralRe: WPF / MVVM - Modular Design Question Pin
SledgeHammer0111-Mar-13 10:20
SledgeHammer0111-Mar-13 10:20 
GeneralRe: WPF / MVVM - Modular Design Question Pin
Wayne Gaylard12-Mar-13 1:38
professionalWayne Gaylard12-Mar-13 1:38 
AnswerRe: WPF / MVVM - Modular Design Question Pin
Abhinav S10-Mar-13 5:31
Abhinav S10-Mar-13 5:31 
GeneralRe: WPF / MVVM - Modular Design Question Pin
SledgeHammer0111-Mar-13 14:52
SledgeHammer0111-Mar-13 14:52 
AnswerRe: WPF / MVVM - Modular Design Question Pin
Abhinav S11-Mar-13 17:03
Abhinav S11-Mar-13 17:03 
GeneralRe: WPF / MVVM - Modular Design Question Pin
SledgeHammer0111-Mar-13 17:38
SledgeHammer0111-Mar-13 17:38 
QuestionHow to expand TreeViewItem programatically? Pin
SledgeHammer013-Mar-13 19:16
SledgeHammer013-Mar-13 19:16 
Been messing around with this all day and its not working for some reason. I know as you expand a node, you have to wait for the ItemContainerGenerator to do its thing, which is what I'm doing, but its only expanding one level for some reason:

    internal void ExpandAll(TreeViewItem tvi)
    {
        if (tvi.IsExpanded)
        {
            for (int nIndex = 0; nIndex < tvi.Items.Count; nIndex++)
            {
                TreeViewItem tviCurrent = tvi.ItemContainerGenerator.ContainerFromIndex(nIndex) as TreeViewItem;

                if ((object)tviCurrent != null)
                    ExpandAll(tviCurrent);
            }
        }
        else
        {
            if (tvi.ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated)
            {
                EventHandler handler = null;

                handler = new EventHandler(delegate
                {
                    if (tvi.ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated)
                    {
// ONLY GETS IN HERE ONCE                       tvi.ItemContainerGenerator.StatusChanged -= handler;
                        ExpandAll(tvi);
                    }
                });

                tvi.ItemContainerGenerator.StatusChanged += handler;
            }

            tvi.SetCurrentValue(TreeViewItem.IsExpandedProperty, true);
        }
    }


So I only get inside the EventHandler one time. It doesn't get in there for the child nodes. If I expand the child node manually, THEN the handler code is called.

Also tried the built in .Net ExpandSubTree and it has the same issue. Only expands one level down.

I don't think I'm intercepting anything anywhere.
AnswerRe: How to expand TreeViewItem programatically? Pin
Mycroft Holmes4-Mar-13 11:49
professionalMycroft Holmes4-Mar-13 11:49 
GeneralRe: How to expand TreeViewItem programatically? Pin
SledgeHammer014-Mar-13 12:09
SledgeHammer014-Mar-13 12:09 
GeneralRe: How to expand TreeViewItem programatically? Pin
Mycroft Holmes3-Apr-13 14:06
professionalMycroft Holmes3-Apr-13 14:06 
QuestionAuto complite text box Pin
columbos149273-Mar-13 8:51
columbos149273-Mar-13 8:51 
AnswerRe: Auto complite text box Pin
Wayne Gaylard4-Mar-13 6:26
professionalWayne Gaylard4-Mar-13 6:26 
QuestionOverride Textbox Pin
Kevin Marois1-Mar-13 8:16
professionalKevin Marois1-Mar-13 8:16 
AnswerRe: Override Textbox Pin
Richard MacCutchan2-Mar-13 0:05
mveRichard MacCutchan2-Mar-13 0:05 
AnswerRe: Override Textbox Pin
Pete O'Hanlon2-Mar-13 1:09
mvePete O'Hanlon2-Mar-13 1:09 
GeneralRe: Override Textbox Pin
Kevin Marois5-Mar-13 11:01
professionalKevin Marois5-Mar-13 11:01 
GeneralRe: Override Textbox Pin
Pete O'Hanlon5-Mar-13 11:18
mvePete O'Hanlon5-Mar-13 11:18 
QuestionLimit Text Input Length Pin
Kevin Marois1-Mar-13 8:10
professionalKevin Marois1-Mar-13 8:10 
AnswerRe: Limit Text Input Length Pin
Mycroft Holmes1-Mar-13 23:41
professionalMycroft Holmes1-Mar-13 23:41 
AnswerRe: Limit Text Input Length Pin
Pete O'Hanlon3-Mar-13 9:59
mvePete O'Hanlon3-Mar-13 9:59 
QuestionPrism Pin
Kevin Marois1-Mar-13 6:33
professionalKevin Marois1-Mar-13 6:33 
AnswerRe: Prism Pin
Jason Gleim1-Mar-13 7:43
professionalJason Gleim1-Mar-13 7:43 
GeneralRe: Prism Pin
Kevin Marois1-Mar-13 7:47
professionalKevin Marois1-Mar-13 7:47 
QuestionC# combobox in datagrid filling Pin
Member 975714928-Feb-13 0:07
Member 975714928-Feb-13 0:07 

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.