AC.AvalonControlsLibrary.Controls.DatePicker.OnApplyTemplate C# (CSharp) Метод

OnApplyTemplate() публичный метод

override to get the templated controls
public OnApplyTemplate ( ) : void
Результат void
        public override void OnApplyTemplate()
        {
            //Focus the popup if it exists in the Control template
            Popup popup = GetTemplateChild("Popup") as Popup;
            if (popup != null)
            {
                popup.Opened += delegate
                {
                    popup.Focus();
                };
            }

            datesList = GetTemplateChild("PART_Dates") as Selector;
            backButton = GetTemplateChild("PART_MonthBack") as ButtonBase;
            forwardButton = GetTemplateChild("PART_MonthForward") as ButtonBase;
        
            backButton.Click += BackButtonClick;
            forwardButton.Click += ForwardButtonClick;
            datesList.SelectionChanged += DatesListSelectionChanged;
            //if the control is a listbox then set the selection mode
            ListBox list = datesList as ListBox;
            if (list != null && DatesSelectionMode != SelectionMode.Single)
            {
                CurrentlySelectedDates = new ObservableCollection<DateTime>();
                list.SelectionMode = DatesSelectionMode;
            }
            
            ReBindListOfDays();
        }