c# wpf Multibindings not aviable
Asked Answered
D

1

6

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.

Driedup answered 26/2, 2015 at 12:54 Comment(0)
A
14

Use MultiBinding, not Multibinding. XAML is case sensitive.

Armillary answered 26/2, 2015 at 12:56 Comment(1)
Cannot believe this solved my issue, funny MultiBinding is still not choseable in Intellisense, like other Classes like TextBlock are. - Anyway Thanks alotDriedup

© 2022 - 2024 — McMap. All rights reserved.