From 2fb7c40a93d600afaad8f53cfdda7ad0ad3c179b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=8B=A5=E8=BE=B0?= Date: Tue, 14 Oct 2025 11:40:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20TextBlockBuilder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TextBlockBuilder.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TextBlockBuilder.md b/TextBlockBuilder.md index 10c5ddf..95d10bd 100644 --- a/TextBlockBuilder.md +++ b/TextBlockBuilder.md @@ -212,7 +212,7 @@ private static TextBlockParam param = TextBlockParam.Default.SetDifferenceByEmpt ``` csharp // 这里的 pure 方法的作用就是充当一个纯拼接器,并且由于它会返回一个包裹器框架类,而不是接口对象,所以可以调用 BuildBlockByAgentOnce 方法,直接返回我们需要的 TextBlockBuilder -_blockBuilder = Pure(Color(Color.white, Value("重量")), Value(1.23), Size(20, Value("kg"))).BuildBlockByAgentOnce(); +_blockBuilder = Pure(Color(Color.white, Label("重量")), Value(1.23), Size(20, Label("kg"))).BuildBlockByAgentOnce(); // 这个示例为了展示字符串拼接的功能,所以移除了color块,可以看到包裹器框架可以直接与字符串拼接。 _blockBuilder = ((BlockBuilderAgent)("重量" + Value(1.23) + Size(20, Label("kg")))).BuildBlockByAgentOnce();