If I remember correctly (though I haven't touched on it for a long time!), a FrameworkElement has a Margin property which will give you the X/Y of an object on it's container (eg: a Canvas).
However, not sure if it applies to a UIElement.
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Reply to: WPF a step backwards in some ways
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "WPF a step backwards in some ways"
Collapse
-
MSDN has always been horrible IMO. But the technologies themselves, not. I use books or internet forums when I'm stuck just as with Spring or other Java stuff.
Maybe Nick's getting a bit old for all these new things
Leave a comment:
-
Originally posted by suityou01 View PostLost you there buddy, if I know how wide something is, and how high something is doesn't mean I know where it is, even if I divide by 2 and subtract one from t'other.
Of course if it's been rotated 180 degrees, that'll now be the bottom right...
Leave a comment:
-
Originally posted by VectraMan View PostI think Bill Gates must have spilled Nick's pint at some point. MSDN has generally been getting worse, but it's still better than trying to piece together information on HTML, as I've been finding out (and even that's better than Adobe's Flash documentation).
I don't know about WPF, but it sounds like they've implemented a proper graphics system, where you wouldn't have such crude concepts of a rectangle with top,left properties. What you have is an object with a size and a transform. I would expect there's a way of finding the width and height of the object, so the top left is -width/2, -height/2, and then apply the transform to that.
Leave a comment:
-
I thought WinForms had poor performance but they really outdid themselves with WPF...
Leave a comment:
-
I think Bill Gates must have spilled Nick's pint at some point. MSDN has generally been getting worse, but it's still better than trying to piece together information on HTML, as I've been finding out (and even that's better than Adobe's Flash documentation).
I don't know about WPF, but it sounds like they've implemented a proper graphics system, where you wouldn't have such crude concepts of a rectangle with top,left properties. What you have is an object with a size and a transform. I would expect there's a way of finding the width and height of the object, so the top left is -width/2, -height/2, and then apply the transform to that.
Leave a comment:
-
Originally posted by NickFitz View PostOut of idle curiosity I went to have a look through the WPF documentation at MSDN Library but it was impossible to find.
A Google search uncovered it at the URL Windows Presentation Foundation - I really should have guessed that it would come under the name 754130, I suppose.
On the offchance that I might still be able to help, I scanned the available resources and had a look at "Layout System" (as mere n00bs like myself call it - a MSMaven would of course know that its real name is 745058). This eventually led me to some documentation for a horrendously overblown object model, somewhat reminiscent of Microsoft's corporate structure in that it contained many layers that did nothing but manage other things, and very few layers that did anything useful, but from which I was able to determine that the Application.Current property seems not to have a RootVisual property.
Back to Google, and it turns out that there is such a property, at least in theory. It's only supported on Silverlight 3.0 and 4.0 and Windows Phone 7.0 and you don't mention which of the dozen or so platforms Microsoft's many management teams have now managed to get out there competing with each other you're trying to deal with, so I thought I'd give up.
BTW, your thread title is all wrong: it should be "Everything Microsoft has done in years many steps backwards in every way; the mere fact that they can't construct a web site that provides access to the documentation of their products unless one turns to the company they regard as their greatest competitor to find what one needs says it all" but I suppose that wouldn't fit.
I don't think anybody else has managed to create such an impenetrable thicket of their documentation as MS have with the MSDN Library these days. That fact alone should give you a strong hint that you should consider turning your attention to other technologies. Microsoft may continue to be an apparently viable option for a few more years, but only in the way that people could still say IBM were a viable option around 1987. The writing was already on the wall for IBM then, and it's there for MS now.
Leave a comment:
-
Out of idle curiosity I went to have a look through the WPF documentation at http://msdn.microsoft.com/library but it was impossible to find.
A Google search uncovered it at the URL http://msdn.microsoft.com/en-gb/library/ms754130.aspx - I really should have guessed that it would come under the name 754130, I suppose.
On the offchance that I might still be able to help, I scanned the available resources and had a look at "Layout System" (as mere n00bs like myself call it - a MSMaven would of course know that its real name is 745058). This eventually led me to some documentation for a horrendously overblown object model, somewhat reminiscent of Microsoft's corporate structure in that it contained many layers that did nothing but manage other things, and very few layers that did anything useful, but from which I was able to determine that the Application.Current property seems not to have a RootVisual property.
Back to Google, and it turns out that there is such a property, at least in theory. It's only supported on Silverlight 3.0 and 4.0 and Windows Phone 7.0 and you don't mention which of the dozen or so platforms Microsoft's many management teams have now managed to get out there competing with each other you're trying to deal with, so I thought I'd give up.
BTW, your thread title is all wrong: it should be "Everything Microsoft has done in years many steps backwards in every way; the mere fact that they can't construct a web site that provides access to the documentation of their products unless one turns to the company they regard as their greatest competitor to find what one needs says it all" but I suppose that wouldn't fit.
I don't think anybody else has managed to create such an impenetrable thicket of their documentation as MS have with the MSDN Library these days. That fact alone should give you a strong hint that you should consider turning your attention to other technologies. Microsoft may continue to be an apparently viable option for a few more years, but only in the way that people could still say IBM were a viable option around 1987. The writing was already on the wall for IBM then, and it's there for MS now.Last edited by NickFitz; 20 December 2010, 06:45.
Leave a comment:
-
WPF a step backwards in some ways
HTF do you get the topleft coords of a UI element?
I got this code
Code:GeneralTransform objGeneralTransform = myObj.TransformToVisual(Application.Current.RootVisual as UIElement); Point point = objGeneralTransform.Transform(new Point(0, 0)); double myObjTop = point.Y; double myObjLeft = point.X;
In the good old days of hwnds and windows api this was a piece of piss, even windows forms has properties for top and left.Tags: None
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Streamline Your Retirement with iSIPP: A Solution for Contractor Pensions Sep 1 09:13
- Making the most of pension lump sums: overview for contractors Sep 1 08:36
- Umbrella company tribunal cases are opening up; are your wages subject to unlawful deductions, too? Aug 31 08:38
- Contractors, relabelling 'labour' as 'services' to appear 'fully contracted out' won't dupe IR35 inspectors Aug 31 08:30
- How often does HMRC check tax returns? Aug 30 08:27
- Work-life balance as an IT contractor: 5 top tips from a tech recruiter Aug 30 08:20
- Autumn Statement 2023 tipped to prioritise mental health, in a boost for UK workplaces Aug 29 08:33
- Final reminder for contractors to respond to the umbrella consultation (closing today) Aug 29 08:09
- Top 5 most in demand cyber security contract roles Aug 25 08:38
- Changes to the right to request flexible working are incoming, but how will contractors be affected? Aug 24 08:25
Leave a comment: