Dynamo.Controls.DynamoView.InitializeStartPage C# (CSharp) Method

InitializeStartPage() private method

This method inserts an instance of "StartPageViewModel" into the "startPageItemsControl", results of which displays the Start Page on "DynamoView" through the list item's data template. This method also ensures that there is at most one item in the "startPageItemsControl". Only when this method is invoked the cost of initializing the start page is incurred, when user opts to not display start page at start up, then this method will not be called (therefore incurring no cost).
private InitializeStartPage ( bool isFirstRun ) : void
isFirstRun bool /// Indicates if it is the first time new Dynamo version runs. /// It is used to decide whether the Gallery need to be shown on the StartPage. ///
return void
        private void InitializeStartPage(bool isFirstRun)
        {
            if (DynamoModel.IsTestMode) // No start screen in unit testing.
                return;

            if (startPage == null)
            {
                if (startPageItemsControl.Items.Count > 0)
                {
                    var message = "'startPageItemsControl' must be empty";
                    throw new InvalidOperationException(message);
                }

                startPage = new StartPageViewModel(dynamoViewModel, isFirstRun);
                startPageItemsControl.Items.Add(startPage);
            }
        }
DynamoView