Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 856093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:11:07+00:00 2026-05-15T08:11:07+00:00

I have 3 wpf control name A B C. I want to bind C

  • 0

I have 3 wpf control name “A” “B” “C”. I want to bind C control height.

Easy understand: C.Height=A.Height+B.Height

This is my dream. 🙂

< C >
 < C.Height >
  < SumBinding >
    < Binding ElementName=A, Path=Height/ >
    < Binding ElementName=B, Path=Height/ >
  < /SumBinding >
 < /C.Height >
< /C >

How to do it?

Is it possible to do not using converter?

Otherwise possible to create SumBinding like class?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:11:07+00:00Added an answer on May 15, 2026 at 8:11 am

    You can bind a property to multiple bindings using a MultiBinding, although you will need to use a converter implementing IMultiValueConverter in order to use them. In this case, you will probably want to bind to Height rather than ActualHeight so that you get the value after layout is performed.

    You would define a converter like this:

    public class SumConverter
        : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            return values.Cast<double>().Sum();
        }
    
        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
    

    And then do something like this in XAML:

    <Control Name="C">
        <Control.Resources>
            <local:SumConverter x:Key="SumConverter"/>
        </Control.Resources>
        <Control.Height>
            <MultiBinding Converter="{StaticResource SumConverter}">
                <Binding Path="ActualHeight" ElementName="A" />
                <Binding Path="ActualHeight" ElementName="B" />
            </MultiBinding>
        </Control.Height>
    </Control>
    

    If you’re just trying to get the height of controls to be in a fixed ratio with each other, you might want to use a Grid with star sizing or multiple grids with shared size groups. Something like this might work:

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="2*"/>
        </Grid.RowDefinitions>
        <Button Grid.Row="0">A</Button>
        <Button Grid.Row="1">B</Button>
        <Button Grid.Row="2">C</Button>
    </Grid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using WPF, I have a TreeView control that I want to set its ItemTemplate
I have a WPF control, that has a list of Investors, and in the
If you have a WPF control library which you wanted to license to developers,
The WPF control WindowsFormsHost inherits from IDisposable. If I have a complex WPF visual
Each item in a WPF ListBox control seems to have a bit of left
So, I have a WindowsFormsHost control in my WPF app (hosting a Dundas Chart)
I have a WPF Window which has a among other controls hosts a Frame.
I have WPF ListBox which is bound to a ObservableCollection, when the collection changes,
I have a WPF project and I'm trying to setup a NAnt build script
I have a WPF application in VS 2008 with some web service references. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.