public override IReadOnlyCollection <NavFormControl> GetGlobalNavFormControls() { var controls = new List <NavFormControl>(); if (CreateSystem.GetInfo().IsIdenticalToCurrent()) { return(controls); } controls.Add( NavFormControl.CreateText( new NavFormControlSetup(100.ToPixels(), "test"), v => new NavFormControlValidationResult("This doesn’t actually work."))); controls.Add( NavFormControl.CreateText( new NavFormControlSetup(100.ToPixels(), "test"), v => new NavFormControlValidationResult("This doesn’t actually work."))); return(controls); }
IReadOnlyCollection <NavFormControl> UiEntitySetupBase.GetNavFormControls() => NavFormControl.CreateText( new NavFormControlSetup(100.ToPixels(), "Lookup!"), v => new NavFormControlValidationResult("Lookup '{0}' failed.".FormatWith(v))) .ToCollection();
EntityUiSetup UiEntitySetup.GetUiSetup() { var one = new ModalBoxId(); var two = new ModalBoxId(); return(new EntityUiSetup( navActions: new HyperlinkSetup(new ExternalResource("http://www.microsoft.com"), "Go to Microsoft") .Append <ActionComponentSetup>(new ButtonSetup("Custom script", behavior: new CustomButtonBehavior(() => "alert('test');"))) .Append( new ButtonSetup( "Menu", behavior: new MenuButtonBehavior( new StackList( new EwfHyperlink(new ExternalResource("http://www.apple.com"), new StandardHyperlinkStyle("Apple")).ToComponentListItem() .Append( new EwfHyperlink(new ExternalResource("http://www.microsoft.com"), new StandardHyperlinkStyle("Microsoft")).ToComponentListItem()) .Append(new EwfHyperlink(new ExternalResource("http://www.google.com"), new StandardHyperlinkStyle("Google")).ToComponentListItem()) .Append( new EwfButton(new StandardButtonStyle("Custom script"), behavior: new CustomButtonBehavior(() => "alert('test!');")) .ToComponentListItem()) .Append( new EwfButton( new StandardButtonStyle("Modal"), behavior: new OpenModalBehavior( one, etherealChildren: new ModalBox( one, true, new Paragraph("This is a modal box!".ToComponents()).ToCollection()).ToCollection())) .ToComponentListItem())).ToCollection()))) .Append( new ButtonSetup( "Modal Window", behavior: new OpenModalBehavior( two, etherealChildren: new ModalBox( two, true, new EwfImage(new ImageSetup("Houses in the mountains"), new ExternalResource("http://r0k.us/graphics/kodak/kodak/kodim08.png")) .ToCollection()).ToCollection()))) .Materialize(), navFormControls: NavFormControl.CreateText( new NavFormControlSetup(100.ToPixels(), "Lookup!"), v => new NavFormControlValidationResult("Lookup '{0}' failed.".FormatWith(v))) .ToCollection(), actions: new ButtonSetup( "Delegate action", behavior: new PostBackBehavior( postBack: PostBack.CreateFull( id: "delegate", modificationMethod: () => PageBase.AddStatusMessage(StatusMessageType.Info, "Did Something.")))) .Append <ActionComponentSetup>( new HyperlinkSetup(new ExternalResource("http://www.google.com").ToHyperlinkNewTabBehavior(), "Go to Google in new window")) .Append( new ButtonSetup( "Generate error", behavior: new PostBackBehavior( postBack: PostBack.CreateFull(id: "error", modificationMethod: () => { throw new ApplicationException(); })))) .Materialize(), entitySummaryContent: new Paragraph( "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis semper dui. Aenean egestas dolor ac elementum lacinia. Vestibulum eget." .ToComponents()).ToCollection())); }