I did this in the xaml ala Event Trigger. If anyone has any optimizations for this, then anyway, please suggest away, I'm pretty green with that.
UPDATE ... and this partially works, except that now the ComboBox does not open again after the selection and the item in the tree.
... xmlns:s="clr-namespace:System;assembly=mscorlib" ... ... <ControlTemplate.Resources> .... <Storyboard x:Key="ClosePopup" Duration="0:0:0" Storyboard.TargetName="PART_Popup" Storyboard.TargetProperty="IsOpen" > <ObjectAnimationUsingKeyFrames> <DiscreteObjectKeyFrame KeyTime="0:0:0"> <DiscreteObjectKeyFrame.Value> <s:Boolean>False</s:Boolean> </DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame> </ObjectAnimationUsingKeyFrames> </Storyboard> ... </ControlTemplate.Resources> ... <TreeView x:Name="PART_TreeView" ... > ... <TreeView.Triggers> <EventTrigger RoutedEvent="TreeView.SelectedItemChanged"> <EventTrigger.Actions> ... <BeginStoryboard Storyboard="{StaticResource ClosePopup}"/> </EventTrigger.Actions> </EventTrigger> </TreeView.Triggers> ... </TreeView> ...
Dave source share