Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# wpf Multibindings not aviable

what i want to do is quite simple. I have got a Window and I Want the Title to be bound to two different Properties. The Title should be Updated everytime one of the Properties changes.

What I tried first and didnt work

<Window x:Class="MyNamespace.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="{Binding Path=Clientname} {Binding Path=LoadedConfiguration}" 

So then I read here and here about Multibindings. And tried its usage like this what actually doesnt work, too

<Window x:Class="MyNamespace.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<Window.Title>
    <Multibinding StringFormat="{}{0} + {1}">
        <Binding Path="Clientname" />
        <Binding Path="LoadedConfiguration" />
    </Multibinding>
</Window.Title>

The Error ist that Multibinding is not supported in a WPF project, what in my opinion doesnt make any sense.

So, what im guessing is a missing xmlns or a missing .dll. I found out that Multibindings are inside "PresentationFramework.dll", which i have referenced. According to msdn, you need either http://schemas.microsoft.com/winfx/2006/xaml/presentation or http://schemas.microsoft.com/netfx/2007/xaml/presentation to include, which I did.

Here I may actually not get any further, I hope you get.

like image 372
LuckyLikey Avatar asked Feb 26 '15 12:02

LuckyLikey


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is C in C language?

What is C? C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.

Is C language easy?

Compared to other languages—like Java, PHP, or C#—C is a relatively simple language to learn for anyone just starting to learn computer programming because of its limited number of keywords.

Why is C named so?

Because a and b and c , so it's name is C. C came out of Ken Thompson's Unix project at AT&T. He originally wrote Unix in assembly language. He wrote a language in assembly called B that ran on Unix, and was a subset of an existing language called BCPL.


1 Answers

Use MultiBinding, not Multibinding. XAML is case sensitive.

like image 125
dymanoid Avatar answered Sep 19 '22 02:09

dymanoid