wpfsilverlight-4.0

Can we concat two properties in data binding?


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


Solution

  • 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; }
    }