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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:35:28+00:00 2026-05-18T05:35:28+00:00

what I am trying to do is relatively simple. I am just trying to

  • 0

what I am trying to do is relatively simple. I am just trying to bind the Y element of a TranslateTransform on an ellipse to 1/2 the height of the ellipse:

    <Ellipse Name="EllipseOnlyLFA" Height="200" Fill="Yellow" HorizontalAlignment="Left" VerticalAlignment="Bottom" ClipToBounds="True">
        <Ellipse.Width>
            <Binding ElementName="EllipseOnlyLFA" Path="Height"/>
        </Ellipse.Width>
        <Ellipse.RenderTransform>
            <TranslateTransform>
                <TranslateTransform.Y>
                    <Binding Converter="MultiplyByFactor" ElementName="EllipseOnlyLFA" Path="Height"  ConverterParameter="0.5"/>
                </TranslateTransform.Y>
            </TranslateTransform>
        </Ellipse.RenderTransform>
    </Ellipse>

I also have the following converter:

public class MultiplyByFactor : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return ((double)value * (double)parameter);
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return true;
    }
}

I am getting an error on the XAML line where I actually use the converter. The error is

‘Set property
‘System.Windows.Data.Binding.Converter’
threw an exception.’ Line number ’22’
and line position ‘8’.

Can anyone shed some light on how to do this? EDIT: Yes, I have the converter added as a resource.

  • 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-18T05:35:28+00:00Added an answer on May 18, 2026 at 5:35 am

    There are 2 thing wrong with your code

    1) your converter needs to be accessed using the StaticResource declaration

    <Binding Converter="{StaticResource myMultiplyByFactor}" 
        ElementName="EllipseOnlyLFA" Path="Height"  ConverterParameter="0.5"/
    

    2) Your converter parameter is a string by default, so you need to convert it to a double

    public object Convert(object value, Type targetType, 
        object parameter, CultureInfo culture)
    {
        double.TryParse((parameter as string).Replace(',', '.'), NumberStyles.Any, CultureInfo.InvariantCulture, out double param);
        return param * (double)value;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to do some relatively simple .htaccess rules to 301 redirect some URLs.
I'm trying to compile a relatively simple c++ program using cygwin and g++. I
Relatively new to rails and trying to model a very simple family tree with
I've been trying to create what I think is a relatively simple layout for
There is a relatively simple thing I'm trying to achieve but I'm unsure how
I'm trying to do something relatively simple here. Basically I have a table with
I'm trying to join two relatively simple tables together, but my query is experiencing
I'm just trying to get a simple test app working with AlarmManager. public class
I'm trying to do what I thought was a relatively simple calculation between 2
I'm trying perform a relatively basic TCP socket send/receive operation on Windows CE using

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.