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

  • Home
  • SEARCH
  • 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

The project I am working on has a rich text box that can have
I have the following line in my Window stanza in the XAML file: Closing=Window_Closing
I am currently learning WPF (C#) and have taken the following simple data binding
Thanks to this question (click me!) , I have the Source property of my
I am trying to get Undo/Redo keyboard shortcuts working in my WPF application (I
As I'm working through an SL3/SL4 application, and starting to work with fonts, I'm
I need to do this in order to create a dynamic background brush for
I am having a weird problem with C#, I can't yet explain. I actually
I am beginner in an silverlight application. So at first i looked on demo
Could someone help me out, to why my listbox is empty? The XmlDocument contains

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.