I was just curious to see if there was some analog to XSLT in WinForms.
I'd like to be able to have my data be defined in XML, then process it
with some kind of style sheet/transformation to dyamically "render"
forms and their constituent controls on-the-fly.
Would XAML fit this description, or am I barking up the wrong tree?
Thanks In Advance!
-Evan
I don't think there is a relation between WinForms and XML. XSLT is an
XML based technology used for transforming infosets into different
representations. WinForms is a presentation layer for .NET. XAML is a
language that is used for Avalon development, which is another presentation
layer based on managed code.
There is little, if any, overlap here.
You can use XSLT to produce anything you want. Perhaps you are
confusing the fact that XSLT generators can output HTML?
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"Evan Stone" <evan_stone_n0spaam@intuit_n0spaam.com> wrote in message
news:ODlo864P...@TK2MSFTNGP12.phx.gbl...
Nicholas (above) is correct. XSLT is a "transform" document for XML data.
You can use it for whatever you like I suppose.
There should be nothing keeping you from either using the DynamicAttributes
property of most objects or deciding on an XML (or other) format that best
describes your Form layout. Then you can create documentation on how to
edit the FormConfig.xml and you have a configurable GUI.
Tom P.
I wasn't asking for a way to transform XML into WinForm data using XSLT
specifically, but rather was asking if there was an existing framework
which behaved in a simliar fashion: i.e. a form _description_ in XML
which then gets "compiled" at runtime into a Form with controls.
From what I've read here:
http://www.ondotnet.com/pub/a/dotnet/2004/01/19/longhorn.html
It sounds like XAML comes pretty darn close to that goal, especially if
one opts to compile at runtime. I haven't done any experiments with XAML
yet, so that's pretty much conjecture on my part, but it seems reasonable.
I'm actually a little surprised that there isn't already a framework
that exists to do this (aside from XAML/Avalon), since this is a fairly
common problem to address among metadata-driven UIs.
Perhaps this is an opportunity to create such a system... :)
Thanks!
-Evan
Actually, I believe I that have heard of a company offering a package to do
what you are talking about. I don't recall their name. They are basically
(as I understood it) promoting their package as a way of playing around with
Avalon without having to wait for Avalon. You might try doing a Google
search. Maybe a search term something like "Windows XAML". You might also
try checking Xtras.net as they carry a pretty good selection of 3rd party
software.
If you keep your requirements pretty simple, it may not be too hard to
implement your basic implementation. Something like this for creating the
controls:
for each element in the document
determine the control's type
create the control
set the control's size and location
next element
And then to get the data:
for each control
append the Control.Text to the data
next
return the data
Richard Rosenheim
"Evan Stone" <evan_stone_n0spaam@intuit_n0spaam.com> wrote in message
news:ODlo864P...@TK2MSFTNGP12.phx.gbl...
> Actually, I believe I that have heard of a company offering a package to do
> what you are talking about. I don't recall their name. They are basically
> (as I understood it) promoting their package as a way of playing around with
> Avalon without having to wait for Avalon.
You're referring to Xamlon here, right? I looked at their offering a
little while ago and it didn't exactly fill my need at the time, but
since the topic of XAML is rearing its ugly head again perhaps I'll take
another look, since the context under which I was examining it in the
past was a bit different...
I'll see what Xamlon can do for us, and in the meantime if anyone else
has any more suggestions I'd be open to hearing them. :)
Thanks!
-Evan
You could have a look at one of the at least two fairly seroius
"Avalon-lookalikes" for pre-Avalon developers:
MyXAML (free) http://www.myxaml.com
Xamlon (commercial) http://www.xamlon.com
Enjoy!
Marc
================================================================
Marc Scheuner May The Source Be With You!
Berne, Switzerland m.scheuner -at- inova.ch
Two more options for you:
1. Use the WebBrowser control to host IE on your form. Then, use XSLT and
HTML to build your page. When applicable, this is a very nice approach as it
gives your application a nice HTML feel, and makes it easier for you to
implement a Web version later. On the other hand, you’ll lose the total
flexibility that WinForms provide; and, also, the IE control takes a lot of
memory.
2. If you’re form layout is fairly static, and you’re mostly interested in
populating the controls with XML data and update the XML back with user
updates, then take a look at the Dynamic DOM (http://www.xrules.org). The
DynamicDOM is an extension to the DOM (XmlDocument class) but it’s, hmm,
dynamic. For example, if you change the AdjustedGrossIncome node then the
TaxAmount node changes automatically (you can probably tell that I’m still
working on my tax forms ;) ). The relations and calculations between the
nodes are expressed in XML using XRules. You’ll need to write some glue code
to link the UI controls to the DDOM, but you’ll get to have your business
rules expressed in XML and applied in the UI without changing your code.
Regards,
Waleed
http://www.xrules.org
I like the way you think. We are similar thinkers. I am currently working on
an XSD defined data framework, and ultimately I will generate GUI's as well
as database schema's and data access layers from this XSD.
Maybe you and I can collaborate and swap ideas a little more.
I did a test case a year back which actually let you edit a running form,
like you could pickup and resize controls. I have a few weird things like
that. Another lets you scrape out the data of a running form and repopulate
it for setting up tests on UI's.
Chris.