473,396 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Re: Use MultiBinding to bind polyline point to a thumb

>I have a sample similar to a previous post where I was binding a line end
>to a thumb. now I'm trying to bind a polyline point to a thumb. in this
case its the first point, but later it could be any point which I will want
to do. In this sample I'm not getting errors, but the binding doesn't seem
to be doing anything. In the custom polyline class I created a new dp
property called FirstPoint which is Points[0] of the polyline's point
collection and I bound this dp to the center of the thumb. It seems like
it should be working, but doesnt. Can anyone explain why? I attached a
very simple and small project demonstraighting this.
Not sure if I'm right, but I think the problem is that the data binding
doesn't go through the property wrapper, but just calls SetValue directly -
so you're never actually changing Points[0]. The solution is to use a
PropertyChangedCallback:

public static readonly DependencyProperty FirstPointProperty =
DependencyProperty.Register("FirstPoint",
typeof(Point), typeof(ArrowPolyline),
new FrameworkPropertyMetadata(new Point(),
FrameworkPropertyMetadataOptions.AffectsMeasure,
MyCallback));

public static void MyCallback(DependencyObject d,
DependencyPropertyChangedEventArgs e)
{
ArrowPolyline ap = (ArrowPolyline)d;
ap.Points[0] = (Point)e.NewValue;
}

Chris Jobson
Jul 3 '08 #1
0 1120

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bob Lehmann | last post by:
Hi, I'm trying to bind an ArrayList to a DataList. I get the error DataBinder.Eval: 'System.String' does not contain a property with the name Name. I don't know what property of ArrayList...
6
by: moondaddy | last post by:
I'm writing a windows app in WPF and want to change the shape of a thumb to an ellipse. Is this possible? also, the edges of the thumb are beveled. Is it possible to change this to a flat look...
0
by: =?Utf-8?B?YWxleF9jYXJvMQ==?= | last post by:
Hi, I would like to use a multibinding to determine the fill value of my rectangle style. <Style x:Key="StyleRect" TargetType="{x:Type Rectangle}"> <Setter Property="Fill"> <Setter.Value>...
3
by: PW | last post by:
Hi, I just bought a SanDisk Cruzer 4GB "U3" thumb drive. Is it possible to run an Access 2003 MDE off of one, complete with data? If so, what would I have to do to get it to work? Just...
10
by: moondaddy | last post by:
Hi, I have 3 tiny content controls and each has a Path in it to draw some lines. These need to be very small and I'm having trouble making the lines clear. the lines have a stroke thickness of "1",...
1
by: Linda Liu[MSFT] | last post by:
Hi George, I have downloaded your sample project and built it on my machine. When I start the application and click the Button on the window, I get an InvalidCastException on the line of code...
1
by: Linda Liu[MSFT] | last post by:
Hi George, Thank you for posting! This is a quick note to let you know that I am doing research on this issue and will get back to you ASAP. I appreciate your patience! Sincerely,
6
by: raylopez99 | last post by:
This language C# is more primitive than I thought. I just found out that C#2.0 does not support polyline (see below), a very useful feature for connecting points with a line automatically. Only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.