BindableApplicationBar.BindableApplicationBar.GenerateButtonsFromSource C# (CSharp) Method

GenerateButtonsFromSource() private method

private GenerateButtonsFromSource ( ) : void
return void
        private void GenerateButtonsFromSource()
        {
            this.buttonsSourceButtons.Clear();

            if (this.ButtonsSource != null && this.ButtonTemplate != null)
            {
                foreach (var buttonSource in this.ButtonsSource)
                {
                    var button = (BindableApplicationBarButton)
                        this.ButtonTemplate.LoadContent();

                    if (button == null)
                    {
                        throw new InvalidOperationException(
                            "BindableApplicationBar cannot use the ButtonsSource property without a valid ButtonTemplate");
                    }

                    button.DataContext = buttonSource;
                    this.buttonsSourceButtons.Add(button);
                }
            }
        }
        #endregion