AcManager.Controls.AcObjectListBox.OnApplyTemplate C# (CSharp) 메소드

OnApplyTemplate() 공개 메소드

public OnApplyTemplate ( ) : void
리턴 void
        public override void OnApplyTemplate() {
            if (_listBox != null) {
                _listBox.SelectionChanged -= ListBox_SelectionChanged;
            }

            base.OnApplyTemplate();

            _listBox = GetTemplateChild(@"PART_ListBox") as ListBox;
            if (_listBox != null) {
                if (SelectionMode != SelectionMode.Single && InnerItemsSource != null) {
                    _listBox.SelectedItems.Clear();
                    _listBox.SelectedItems.Add(InnerItemsSource.CurrentItem);
                }

                _listBox.SelectionChanged += ListBox_SelectionChanged;
            }
        }