private void SetTextAndHide() { this.popup.IsOpen = false; if (this.listBox.SelectedItem != null) { TargetControl.Text = String.IsNullOrEmpty(DisplayMemberPath) ? this.listBox.SelectedItem.ToString() : this.listBox.SelectedItem.GetType().GetProperty( DisplayMemberPath).GetValue(this.listBox.SelectedItem, null).ToString(); itemsSelected = true; if (MovesFocus) { TargetControl.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); } } }