| «« Parsing XAML with Code In It Dynamically | RSS Feed Changes »» |
|
About
I'm Ryan Lowe, a Software Engineering graduate living in Ottawa, Canada. I like agile software development and Ruby on Rails.
I write this blog in Canadian English and don't use a spell checker. Typos happen.
Projects
» Full-time Ruby on Rails freelancer
» Full-time with Rails since May 2005 » Former committer for RadRails (now Aptana) » I also have a few Rails side-projects in development: 1. wheretogoinTO.com Toronto nightlife 2. Hey Heads Up! TODO list and sharing 3. Layered Genealogy family history research 4. foos for foosball scoring 5. fanconcert for music fans (on hold) Hiring Rails developers? I can telecommute by the hour from Ottawa, Canada »» Email: rails AT ryanlowe DOT ca
BulletBlog
Now hosted on Hey! Heads Up -- check it out!
Syndication
Pings
Recent
Derek Lowe's (Ryan's older brother) words at Ryan's funeral
blog@ryanlowe.ca no more Forging Email Headers: Good, Bad or Ugly? Sarcastic Dictionary (Part 1 of Many) Tags Hierarchies Twisting Rails is Risky Business Risky Business? My Take on Early Alphas Whoa, it's August 2007 Closing Comments A Postscript to "Growth at the grassroots" »» All Blog Posts
Linkage
del.icio.us/ryanlowe
technorati/ryanlowe.ca/blog Aurora Roy Jim Andrew Trasker Travis Kibbee Karen Dr. Unk Ayana Van Bloggers Joel Spolsky Robert Scoble Tim Bray Dave Winer Raymond Chen James Robertson Ruby/Rails Bloggers rubyonrails.org weblog David Heinemeier Hansson Dave Thomas James Duncan Davidson Mike Clark Jamis Buck Signal vs. Noise Tobias Luetke Amy Hoy: (24)slash7 Jeremy Voorhis Eclipse Bloggers Planet Eclipse EclipseZone Luis de la Rosa Eclipse Foundation Kim Horne Billy Biggs Ian Skerrett Mike Milinkovich Bjorn Freeman-Benson Denis Roy
Archives
|
Changing Object Nesting in XAML
One of the really nice things about XUL was the ability to move XML representing the GUI elements like textboxes, list, etc. around quickly, even between different nesting levels, to get the layout right. Writing XUL is a really quick way to whip up prototypes of GUIs, especially since it can be skinned to look exactly like native Win32 apps. I don't know if MS will be promoting XAML has a way to layout GUIs. There will probably be a really nice WYSIWYG editor in Visual Studio that the hardcore developers will never use but is handy for RAD. But in any case, XAML does allow for a really nice presentation/functionality seperation between XAML and code. Define how it's layed out in XAML and how it works in code, is how you could do it. The problem I see is when you start fooling around with the nesting levels or even move objects around the GUI. Think of each nesting level as an object that contains instances of other objects that are nested inside of it. You want to fool around with your XAML code and move an object up one nesting level but now the XAML doesn't correspond with the code and the compiler chokes. So I guess it depends on what their intentions are for XAML in the context of GUIs/Avalon. If they intend developers to layout GUIs with it like XUL then they might want to offer some refactoring support in Visual Studio that detects the change in nesting or movement in the XAML and changes the code to correspond with those movements. Otherwise I could see keeping your XAML and code straight and corresponding being a huge problem, especially for large or complicated UI layouts. Posted at November 13, 2003 at 10:31 AM ESTLast updated November 13, 2003 at 10:31 AM EST Comments
I'm not sure if I understand the question but maybe I can clear this up. think of XAML as an XML description of the heirarchy of your applications objects. This means each XML element in XAML will map to a CLR object and each XML attribute in XAML will map to a CLR property e.g. <Window Width="640" Height="480"> 3 things can be done with the above xml 0) It can be converted to a tokenized binary that is essentialy the same as the markup but elements and attributes are converted to tokens, this can be used to speedup download or parsing of XAML 1) It can be loaded at runtime object uiRoot = Parser.LoadXaml(myUIAsAString); //and inspected at runtime TextBox t = f.Children[0]; //This is off the top of my head That's all nice and well but how is that relevant to refactoring your UI without refactoring your code? In XAML when you set the ID attribute on any XML element that maps to a UIElement; If you design your UI carefuly and only assign ID's to elements relevant to your applications logic you can refactor the UI quite a bit and never look at your code twice. Ifeanyi Echeruo [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. » Posted by: Ifeanyi Echeruo at November 23, 2003 07:16 PMThat sounds a bit like DHTML, where you can assign unique IDs to your HTML elements and refer to a specific element in JavaScript, no matter where it is in the document with something like: document.all("tagID").value; » Posted by: Ryan at November 23, 2003 11:37 PM |