Hi all,
I have an open question regarding the possibility of gluing Microsoft's
WPF/E
With jQuery, which seems to me as a very interesting future possibility for
jQuery.

My end goal would be to use jQuery syntax on WPF/E object model, so that for
example

$("a").click(....) // jQuery

Could be used in XAML / WPF/E:
$("TextBlock").click("function(){ $(this).attr("FontSize", "36")});

Generally speaking, since WPF/E does indeed follow a certain object model
that should be possible in theory.
The main problem is that once the WPF/E control loads the XAML data, the
XAML / WPF/E are not visible to jQuery (naturally).

Microsoft does provides API for the object for traversal, look up and
modification (examples below):

--------------------------------- XAML File
---------------------------------------------
<!-- The top-most object in the XAML hierarchy is referred to as the root
object. -->
<Canvas 
  xmlns="http://schemas.microsoft.com/client/2007"; 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml";
  x:Key="rootCanvas">

  <!-- Canvas objects can be a child of another Canvas object. -->
  <Canvas Canvas.Left="20" Canvas.Top="20">
    <Rectangle Width="200" Height="35" Fill="PowderBlue" />
    <TextBlock Canvas.Left="25" Canvas.Top="50" Foreground="Teal"
FontFamily="Verdana">Sample Output</TextBlock>
  </Canvas>

  <TextBlock Canvas.Left="36" Canvas.Top="80" Foreground="Maroon"
FontFamily="Verdana">Hello, world</TextBlock>
</Canvas>
--------------------------------- XAML File
---------------------------------------------

--------------------------------- HTML File
---------------------------------------------
// Find the control object
var control = document.getElementById("WpfeControl1");
// Locate a named object
var canvas = control.findName("rootCanvas");
canvas.children.add(control.createFromXaml('<TextBlock Canvas.Top="200"
Text="Click for more info" />'));
canvas.opacity = 0;
canvas.setValue("opacity", 0.5);
canvas.children.removeAt(0);
canvas.children.clear();
--------------------------------- HTML File
---------------------------------------------

Ideally, jQuery could be somehow extended to work with this object model as
well.

I've tried to asses whether this could be done using a jQuery plugin but I'm
not sure I fully grasp the object model
Or the jQuery object itself for that matter, so I thought I would ask the
developers what they think are the chances of integrating this
As a jQuery plugin...

        TIA,
        Dan.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to