473,804 Members | 3,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 demonstraightin g 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
PropertyChanged Callback:

public static readonly DependencyPrope rty FirstPointPrope rty =
DependencyPrope rty.Register("F irstPoint",
typeof(Point), typeof(ArrowPol yline),
new FrameworkProper tyMetadata(new Point(),
FrameworkProper tyMetadataOptio ns.AffectsMeasu re,
MyCallback));

public static void MyCallback(Depe ndencyObject d,
DependencyPrope rtyChangedEvent Args e)
{
ArrowPolyline ap = (ArrowPolyline) d;
ap.Points[0] = (Point)e.NewVal ue;
}

Chris Jobson
Jul 3 '08 #1
0 1136

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

Similar topics

3
3335
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 I should be using instead of "Name" in default.aspx.
6
21823
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 and if so, how? Here's how I'm creating my thumb so far. cornerThumb = new Thumb(); // Set some arbitrary visual characteristics. cornerThumb.Cursor = customizedCursor; cornerThumb.Height = cornerThumb.Width = 10;
0
3910
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> <MultiBinding Converter="{StaticResource MyMultiValueConverter}"> <Binding Path="PropertyX"/>
3
2862
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 curious. No Biggie! I thought I'd take a break from writing code and try something different. I guess I could go fishing :-) -paulw
10
5460
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", but when I run the app, they become pixilated and blur out. Can someone please help me on this? Thanks. <Grid HorizontalAlignment="Left" Margin="10,0,0,0" Width="11" Height="33"> <Grid.RowDefinitions> <RowDefinition Height="10" />
1
3196
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 "double topLeft = (double)values;" in the Convert method within the LineBindingConverter class. I look into the parameter "values" and find the first element in it is of type DependencyProperty.UnsetValue. Open the source code of the Window1 and
1
5363
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
1815
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 C# 3.0 supports this. I'm curious, what did people do before version 3.0 was released? I guess they had to construct their own functions that manually connected the points? Unreal. I think C# .Forms is beta compared to MFC and C++, but...
0
9576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10323
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10074
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9138
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7613
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2983
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.