score:-1

Accepted answer

I didn't want to hassle more with the beginning space and finally made a decition to just allow the initial space and just strip all spaces from the Meta string eventually anyhow.

The problem actually turns out to be in the event it self so this was by solution for the being. Im not looking anything more into this since in turning over to meta with tags inside the actual message instead. And with a prefix. Eg. @meta Lets see how that works ;)

 private string metaInput { get; set; }
    public string MetaInput 
    {
        get
        {
            return metaInput;
        }

        set 
        {
            string x = value;
            if (x.Length > 3)
            {
                if (x.EndsWith(" "))
                {

                string z = x.Replace(" ", "");
                x = z.Replace(",", "");
                int l = x.Length;

                    if (l > 2)
                    {
                        metaInput = null;
                        SaveMetaWord(x);
                    }

                    else 
                    {
                        metaInput = null;
                    }
                }

            }

            else 
            {
                metaInput = value;
            }

        }
    }

score:2

You final select has to be string and not the anonymous type

 var str = from cu in x
           // your stuff
           select cu.username + cu.fname;

The other option is to keep your anonymous types and use StringFormat in the Binding

<TextBlock >
    <TextBlock.Text>
        <MultiBinding StringFormat="{}{0}  {1}">
            <Binding ElementName="username" Path="Text"/>
            <Binding ElementName="name" Path="Text"/>
        </MultiBinding>
    </TextBlock.Text>
</TextBlock>

Yet another option is to have a field in the anonymous type that has the complete string that you want displayed and use DisplayMemberPath for binding


Related Articles