Coffeehouse Post

Single Post Permalink

View Thread: Why is WPF so complicated?
  • User profile image

    So watching the WPF video on the homepage and I noticed a block of code for the actual button. (Sorry I would Clipster it however it seems like the red button isn't there...) but it went something like...

    <border background="ffffff" padding="12">
        <image x:name="image" height="200" source="normal.jpg" />

    and how it doesn't do anything till you set trigger events.

    <control template.triggers>

    <trigger property="IsPressed" value="true">
        <setter targetnam="image" property="source" value="pressed.jpg" />

    I'm just wondering why they deviated from "known standards" JS. In Boxely (our WPF like platform)...this seems like it would be done simpler....

    <hbox s:fill="ffffff">
        <image id="image" s:height="200" src="normal.jpg" on:click="pressed();" />

    and then your pressed event in a referenced js file would be like...

    function pressed()
        var box = scene.getBoxById("image");
        id (box)
           box.src = "pressed.jpg";

    To me however it seems like in order to do more (like the hovering) it would need to have another tigger property and ALOT of if then statements to change the image. Where as with JS you could do maybe easier and just declare on:mouseover and more...

    I dunno maybe it's the same, it just seems more complicated...