Make sure the class has the @dataTransfer set with the correct id for the project. In this case, the name is frmPROJECTNAME (base project name) + NewMasterPage (name of the new page).
The new master page component needs to extend from the base MasterPageComponent.
You need the references to the head and the content, using Angular's ViewChild.
Finally, you need the head and contentTemplateRef properties, to set the content from a page.
Note: In the previous example, the MasterPage we are adding is inside another MasterPage, that is why we have the ViewChild references and we also set the initializeContainers from a page.
index.ts
import { Site1MasterComponent } from './site1-master/site1-master.component';
import { SummaryPageComponent } from './validation-summary-page/validation-summary-page.component';
import { NewPageComponent } from './new-page/new-page.component';
import { NewMasterComponent } from './new-master/new-master.component';
export { Site1MasterComponent };
export { SummaryPageComponent };
export { NewPageComponent };
export { NewMasterComponent };
project.module.ts
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { BaseComponentsModule } from '@mobilize/base-components';
import { WebMapKendoModule } from '@mobilize/winforms-components';
import { WebMapService, WebMapModule } from '@mobilize/angularclient';
import { WebFormsModule } from '@mobilize/webforms-components';
import { AjaxModule } from '@mobilize/webforms-components';
import * as MyProject from './components/project';
@NgModule({
imports: [
CommonModule,
BaseComponentsModule,
WebMapKendoModule,
WebMapModule,
WebFormsModule,
AjaxModule,
],
exports: [
MyProject.Site1MasterComponent,
MyProject.SummaryPageComponent,
MyProject.NewPageComponent,
MyProject.NewMasterComponent,
],
declarations: [
MyProject.Site1MasterComponent,
MyProject.SummaryPageComponent,
MyProject.NewPageComponent,
MyProject.NewMasterComponent,
],
bootstrap: [
MyProject.Site1MasterComponent,
MyProject.SummaryPageComponent,
MyProject.NewPageComponent,
MyProject.NewMasterComponent,
],
providers: [WebMapService],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
export class OtherValidatorsModule { }
Finally, you need to add the MasterPage in the project index and then in the module.
Backend
In the Backend, you can also copy and paste an existing master page and modify it with the necessary properties you need for the controls you added.
In the NewMasterPage.designer.cs file you just have to set the MasterPageFile property correctly.
namespace ProjectName
{
public partial class NewMaster
{
public NewPage()
{
this.InitializeComponent();
}
private void InitializeComponent()
{
this.MasterPageFile = "ProjectName.MasterSite1";
this.Name = "NewMaster";
// properties initialization
}
}
}
As mentioned before, the master page we are adding is a "NestedMasterPage", so it has a MasterPage as its MasterPageFile and the new pages will have the new NestedMasterPage as its MasterPageFile.
Redirect
To go to the new master page you need to add the NewMaster reference to a new or existing Page, using the MasterPageFile property, this way the mechanism will load both the Page and the MasterPage properly.