Can we concat two properties in data binding?

后端 未结 6 512
别跟我提以往
别跟我提以往 2021-02-01 13:04

Can we concat two properties together in binding expression? If possible without converter or without writing two textblocks and setting them individually?

6条回答
  •  醉话见心
    2021-02-01 13:57

    Like alpha-mouse suggests MultiBinding won't work out of the box, but this guy has thrown something together that might help:

    http://www.olsonsoft.com/blogs/stefanolson/post/Improvements-to-Silverlight-Multi-binding-support.aspx

    If that seems a bit rogue, then maybe try putting a combined value property on your object as a helper for the Binding mechanism, like:

    public string FullName {
       get { return this.FirstName + " " + this.LastName; }
    }
    

提交回复
热议问题