public AudioFilePlayChild(AudioFilePlayModel gotoPagePlayModel, ScriptUserControl suc) : base(suc) { this.audioFilePlayModel = gotoPagePlayModel; //构建对话框 tbPageName = GetTexeBox(gotoPagePlayModel.AudioName); tbPageName.IsEnabled = false; AddTitleAndControl("FileNameColon", tbPageName); GetButton("Replace", ReplaceLight, out Button btnReplace); GetButton("Remove", RemoveLight, out Button btnRemove); AddDockPanel(out DockPanel dp, btnReplace, btnRemove); dp.HorizontalAlignment = HorizontalAlignment.Center; CreateDialog(); tbPageName.LostFocus += TbPolyploidy_LostFocus; }
private BaseOperationModel XNameToModel(XElement xEdit) { BaseOperationModel baseOperationModel = null; if (xEdit.Name.ToString().Equals("LightFile")) { baseOperationModel = new LightFilePlayModel(); } else if (xEdit.Name.ToString().Equals("GotoPage")) { baseOperationModel = new GotoPagePlayModel(); } else if (xEdit.Name.ToString().Equals("AudioFile")) { baseOperationModel = new AudioFilePlayModel(); } baseOperationModel.SetXElement(xEdit); return(baseOperationModel); }