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 4248306
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:14:10+00:00 2026-05-21T04:14:10+00:00

I have the following working XAML code that basically binds a couple of properties

  • 0

I have the following working XAML code that basically binds a couple of properties to calculate the final position of my user control:

<UserControl x:Class="CurvePointControl"
    ....
         >
<UserControl.Resources>
    <local:VToYConverter x:Key="vToYConverter" />
</UserControl.Resources>
<UserControl.RenderTransform>
    <TranslateTransform x:Name="XTranslateTransform" >
        <TranslateTransform.Y>
            <MultiBinding Converter="{StaticResource vToYConverter}">
                <Binding ElementName="curveEditPoint" Path="V"/>
                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type local:CurveEditor}}" Path="MinV"/>
                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type local:CurveEditor}}" Path="MaxV"/>
                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type local:CurveEditor}}" Path="ActualHeight"/>                    
            </MultiBinding>
        </TranslateTransform.Y>
    </TranslateTransform>
</UserControl.RenderTransform>

…

For various reasons (but esp to avoid the relative source, I am now trying to do the same in code behind without success.

This is my current code:

    public CurvePointControl(CurveEditor CV)
    {
        InitializeComponent();

        MultiBinding multiBinding = new MultiBinding();
        multiBinding.Converter = m_VToYConverter;

        multiBinding.Bindings.Add(new Binding("V"));
        multiBinding.Bindings.Add(new Binding(CV.MinVProperty)); // doesn't work
        multiBinding.Bindings.Add(new Binding(CV.MaxVProperty)); // doesn't work
        multiBinding.Bindings.Add(new Binding(CV.ActualHeight)); // doesn't work       
        multiBinding.NotifyOnSourceUpdated= true;

        this.SetBinding(TranslateTransform.YProperty, multiBinding);
        //Doesn't work too:
        //BindingOperations.SetBinding(XTranslateTransform, TranslateTransform.YProperty, multiBinding);

    }

I still can’t believe that it is so hard to convert the XAML into c# code. The converter is called but only once and without valid property values.

Any idea of what’s wrong?
How could I debug such a problem?

  • 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-21T04:14:11+00:00Added an answer on May 21, 2026 at 4:14 am

    You need sources:

    multiBinding.Bindings.Add(new Binding("V") { Source = curveEditPoint }); //If that object is accessible in the current scope.
    multiBinding.Bindings.Add(new Binding("MinV") { Source = CV });
    multiBinding.Bindings.Add(new Binding("MaxV") { Source = CV });
    multiBinding.Bindings.Add(new Binding("ActualHeight") { Source = CV });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following working code: http://jsfiddle.net/NtHwN/4/ It will deduct the number that is
In YUI I have following code working for mouse wheel. How do I make
We have the following code working for a complex rails form with checkboxes. I'm
Right now I have the following code working: @UiHandler(usernameTextBox) void onUsernameTextBoxKeyPress(KeyPressEvent event) { keyPress(event);
I have following code And it is working fine in AIR device simulator on
I am working with NSCache in iOS i have following code in .h file
On a Solaris 5.8 machine, I have the following code: [non-working code] char *buf;
I have the following code which is working, I was wondering if this can
I have the following: An environment that is working like a hash for rows
I have the following code: <Window x:Class=UnderstandSizing.Window2 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=Window2 Height=300 Width=300> <Grid> <Grid.ColumnDefinitions>

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.