// Add to the root a text paragraph which reflects the SimpleText property. private void AddSimpleTextPara(AssembledStyles styles, int ws, RootBox root) { var items = new List <IClientRun>(); var run = new StringClientRun("This is the day that the Lord has made. We will rejoice and be glad in it", styles.WithWs(ws)); items.Add(run); var source = new TextSource(items); var para = new ParaBox(styles, source); var hookup = new StringHookup(this, () => this.SimpleText, hook => SimpleTextChanged += hook.StringPropChanged, hook => SimpleTextChanged -= hook.StringPropChanged, para); hookup.Writer = newVal => SimpleText = newVal; run.Hookup = hookup; root.AddBox(para); }
private void InitSeveralBoxes() { var styles = new AssembledStyles(); RootBox root = new RootBoxFdo(styles); var items = new List <IClientRun>(); items.Add(new BlockBox(styles, Color.Red, 72000, 36000)); items.Add(new BlockBox(styles, Color.Blue, 36000, 18000)); items.Add(new BlockBox(styles, Color.Orange, 18000, 36000)); items.Add(new BlockBox(styles, Color.Green, 72000, 18000)); items.Add(new ImageBox(styles.WithBackColor(Color.Pink).WithBorderColor(Color.Blue) .WithBorders(new Thickness(2.0)).WithPads(new Thickness(4.0)), new Icon(SystemIcons.Shield, 40, 40).ToBitmap())); items.Add(new BlockBox(styles, Color.Yellow, 72000, 36000)); var source = new TextSource(items); var para = new ParaBox(styles, source); root.AddBox(para); theSharpView.Root = root; }
private void InitSeveralBoxes() { var styles = new AssembledStyles(); RootBox root = new RootBoxFdo(styles); var items = new List<IClientRun>(); items.Add(new BlockBox(styles, Color.Red, 72000, 36000)); items.Add(new BlockBox(styles, Color.Blue, 36000, 18000)); items.Add(new BlockBox(styles, Color.Orange, 18000, 36000)); items.Add(new BlockBox(styles, Color.Green, 72000, 18000)); items.Add(new ImageBox(styles.WithBackColor(Color.Pink).WithBorderColor(Color.Blue) .WithBorders(new Thickness(2.0)).WithPads(new Thickness(4.0)), new Icon(SystemIcons.Shield, 40, 40).ToBitmap())); items.Add(new BlockBox(styles, Color.Yellow, 72000, 36000)); var source = new TextSource(items); var para = new ParaBox(styles, source); root.AddBox(para); theSharpView.Root = root; }
// Add to the root a text paragraph which reflects the SimpleText property. private void AddSimpleTextPara(AssembledStyles styles, int ws, RootBox root) { var items = new List<IClientRun>(); var run = new StringClientRun("This is the day that the Lord has made. We will rejoice and be glad in it", styles.WithWs(ws)); items.Add(run); var source = new TextSource(items); var para = new ParaBox(styles, source); var hookup = new StringHookup(this, () => this.SimpleText, hook => SimpleTextChanged += hook.StringPropChanged, hook => SimpleTextChanged -= hook.StringPropChanged, para); hookup.Writer = newVal => SimpleText = newVal; run.Hookup = hookup; root.AddBox(para); }