Jaime Rodriguez
On Windows Store apps, Windows Phone, HTML and XAML

  • Jaime Rodriguez

    dr. wpf rocks..


    Today, Karsten mentioned Dr. WPF....   I am embarrassed to admit I did not know about this phenomenon..  but I just spend the last two hours looking at his/her blog ...  not only is it full of WPF goodies but also funny ...

    Dr. WPF, thanks for being so generous in sharing via posts and forums ....   I really enjoyed a the posts I read so far.. I created a tag just for you on my blog....  

    hats off..

  • Jaime Rodriguez

    too much System.Runtime.InteropServices.ComException ?? :(


    Lately, I have been seeing System.Runtime.InteropServices.COMException quite often when I launch Visual Studio 2008 to work on Silverlight projects..    

    Here is what I know causes the error..

    • Error happens when I have wrong templates installed (e.g. running old versions of the Silverlight tools for 1.1), in particular versions that were meant for VS 2008 beta2..  
      1. Uninstall the old tools,
      2. install new tools
      3. from an administrator command prompt, run
        C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>devenv /REsetSkipPkgs
    • Error also happens when I am trying to open a "Web Application project" in Windows Vista and I have not launched Visual Studio with elevaged privileges..
      1. Run VS with elevated privileges ....  OR
      2. Open project as a web site...  ( File -> Open -> Website and navigate to directory)
    • There is one more scenario, but that one should not be happening to most people.. if you install a later or internal build of the VS tools for Silverlight...  and then end up rolling back to old tools.

    If you are seeing the error, my reccomendation is to at least try
    C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>devenv /REsetSkipPkgs
    That seems to help a lot of things.. 

    Want to know which one gets me?? I forget to elevate, and I need Web App projects (instead of Open As website) because I need 'post-build steps' ... 


  • Jaime Rodriguez

    WPF in Line of business applications ( aka "WPF DID GO to work")


    In a recent family trip, my brother-in-law hooked me up w/ a magazine for the long plane ride; it was Visual Studio Magazine with a "WPF Goes To Work" article in the cover. The article begins with a "Windows Presentation Foundation has been greatly underserved by Microsoft’s emphasis on glitz and glamour; learn how to take advantage of WPF in your everyday Windows business apps" ...

    Picture me sitting on a 4 hour plane ride, with that opener, I went through all the emotions ( in order):

    1. "Kathleen is right" ...  
    2. "should blame it on marketing (sorry guys), WPF was a Vista feature and Vista had a very strong consumer focus" ...
    3. ".. I am part of the problem since we could have shared our success stories, given that the internal perception is that WPF has been more successful in Line Of Business than we initially predicted ( given it shipped before the tools, etc.)
    4. "Well,  the story is not as simple.. there are choices to be made, and this new platform despite all its goodness needs to be explained" -- it is like a hybrid car, we all agree it is good, it is the future, yet it is not cost effective or practical for every one to get one..

    Eventually,  I decided all of these answers are partially right...  so I scribbled my opinions on these topics 

    1. Not much I can say about Kathleen been right; but I do recommend the article. Kathleen shares her personal experiences, uses concise examples and features to illustrate her points and it it obvious she gets client application development.

    2. Evidence --  there are some great case studies that show what enterprises are doing with WPF; I kept it pure, with just URLs so you can hear it from the customers.

    3. The why and where distills a few of the reasons I heard over and over from real customers when they were asking to be early adopters for the technologies;  back then it was risky, we had no books, we had no tools, fortunately for most of them the bets paid off... 

    4. My version on "do I need WPF?" ...  which I hoped would help people with the highest level guidance on choosing a technology (in particular the Windows Forms vs. WPF dilemma).   

    On all of the above, I need to disclaim a couple things:

    1. The list is not all inclusive; I do feel bad about that.. there are many more I can't talk about since we don't have PR agreements or I did not have a URL handy, but I do think the list is representative.
    2. The opinions and experiences you are reading are MINE and not all of Microsoft's; the good news is I was there for most of these; I was lucky to be involved on a lot of these projects so the insights come from my interpretations on working with Microsoft field, customers ( business and devs) and partners..  
    3. I tried to be fair and accurate on the project's results, but on the advise I did extrapolate to today { meaning I did take into account that the platform and most importantly the tools have evolved and improved, so it is less painful today with Blend2 than 2 years ago when some of these projects started} ..
  • Jaime Rodriguez

    Expression Media Encoder video player template debug code posted...


    Creating a Silverlight 1.0 video player using Expression encoder is incredibly easy ( 3 clicks and done).. Debugging it or tweaking it was not as easy... Until now..

    Jim Thill posted the debug ( read:uncrunched, unoptimized ) version of the media encoder templates.. so now you can read and tweak the code..  It also comes with a document on how to document the player skins..

    The template & docs are here. Enjoy!


  • Jaime Rodriguez

    Lotsa tools goodies released recently...


    Lots of tools released recently..  here are my lessons learned after not reading the manual :(

    • Expression Blend 2.0  December CTP was released last week..    I posted on Blend 2.0 before because the last CTP was full of new great features..  
      As far as I have seen from this 2.0 December CTP the big new feature is support for Visual Studio 2008 RTM {as well as a few bug minor fixes} ...  
      The one thing to note is that  Blend 2 December Preview requires the .NET Framework 3.5 and creates solutions for VS 2008...    [not for VS2005] ..   

    A friend asked me if I would recommend installing 3.5 Framework on his box and Blend 2 (so he can  build prototypes using Blend 2 and then cut & paste to his Blend 1.0 projects)?   I have not tried running it side-by-side and I explained to him that there is implications of installing 3.5 on his box, this effectively upgrades your 3.0 framework so if you need to stick with a 3.0 framework for testing or debugging of existing apps -which was his case- I recommend using Blend2 on a VPC or a secondary box ... he is now happy getting the best of both worlds that way.

    • For those people that are developing .NET 3.0  applications, Expression Blend 1.0 SP1 was released last week too.. 
      Unfortunately you don't see all the Blend 2 goodness in the Service pack. From the release notes, it seem the big feature is support for VS 2008 as well as bug fixes..  The big difference here is that Blend 1.0 SP1 does open VS 2008 and VS 2005 projects...  
    • Another 'tools' update released last week was the ASP .NET 3.5 Extensions Preview..  ScottGu has the details on the extensions;  though there is lots of goodies, to me the most exciting feature is the ASP .NET MVC  implementation [which you can learn about via Scott's blog again] ..  
      The one thing to add [to my surprise] is that despite the similar name, the extensions are different from ASP .NET futures, so don't download it to get updates to the Managed JScript  my guess is that updates to managed JScript will come when Microsoft releases the CTP for Silverlight 2.0. ..
    • A belated note on Expression Design SP1, which was released last month...   
      The complete release notes are here; and Joanna has a good description of the new features at the expression team's blog; her post is a must read because some of the features she lists were missing from the release notes but are very important ( like gradient mid-points can now be exported).. 

    That is it ... my machines are up-to-date on tools for now ...   I hope  this helps u decide what to download ..

  • Jaime Rodriguez

    "The New iteration" a paper on designer/developer collaboration using XAML...


    Karl (of mole fame) emails me about "The new iteration" article that Karsten and I wrote a while ago... 

    The paper attempts to do a lot in a few pages:  

    1. Introduce XAML ( in the context of HTML, SVG and the likes) for those not familiar with WPF.
    2. Introduce the workflow you can get when developers and designers create UI using XAML: You get a common language that stream lines collaboration between these two roles. This reduces duplicate work and allows each role to use tools optimized for their specific tasks ( Blend for designers, VS 2008 for developers)..
    3. Provide high level advise on roles and skills when you collaborate to this extent..
    4. Share a few of our lessons learned from many WPF early adopter projects..  
    5. Provide tactical advise for those who already took the journey to WPF and XAML..

    Please do send us your feedback .. there were a lot of topics we know we did not get to,  I am hoping I can tackle some of these via blog posts or screencasts..

    Going back to my old notes on every thing we did not get to I had:
    Controls, Styles, Templates FAQ
    Tips & Tricks on Blend..   way Beyond this very old article..
    Tips & tricks on Blend + Cider, way beyond this intro old intro stuff..
    Expression Designer (there was a lot we just did not get into)
    Tips & trickcs on creating data-driven apps..( I guess this overlaps w/ tips & tricks above)..

    What else do you want to hear about?? Let us know; I am keeping a list and even if I move really, really slow...   I will eventually get to it..






  • Jaime Rodriguez

    reusing animations in Silverlight 1.0


    I have seen a few people create lots of animations to animate different objects instead of reusing existing storyboards..  When asked why they did that, they explain "I tried to reuse it but I got an "AG_E_RUNTIME_SETVALUE" when setting the property... 

    Here are the details on how animations/storyboards work so you can reuse them:

    1. You will get AG_E_RUNTIME_SETVALUE if you try to set a value when storyboard is running:

      var sb = this.control.content.findName("reusable");
      sb.begin ();
      var animation = sb.Children.GetItem(0);        
      // This below will fail because the animation is running...  because the FillBehavior = HoldEnd
      animation["Storyboard.TargetName"] = 'rect2' ;
    2. To get around the error, you must either explicitly call storyboard.stop()  before trying to alter the storyboard, or use the FillBehavior="Stop"
      The problem w/ Stop is that the property you updated using the storyboard will go back to its original value ...  :(
    3. var sb = this.control.content.findName("reusable");
      sb.begin ();
      var animation = sb.Children.GetItem(0);        
      sb.stop ()   /// This makes line below no longer fail...   :)  but it undoes the work that previous ran animation had done..
      animation["Storyboard.TargetName"] = 'rect2' ;

    4. A way to 'hold' the value of the property you animated even after storyboard.stop () is to set it explicitly after you stopped it (duh jaime)... 
      There are fairly generic ways to do this..  (if running <Type>Animation,  then look at To value ... if running <Type>AnimationUsingKeyFrames  then look at last keyframe for that property and set property to that value...
    var sb = this.control.content.findName("reusable");
    // we wire completed...  so we know when to set the value.. 
    sb.addEventListener("Completed", Silverlight.createDelegate ( this, this.onCompleted )); sb.begin ();
    onCompleted : function ( sender , args ) 
            var animation = sender.Children.getItem(0); 
            var ctl = this.control.content.findName ( animation["Storyboard.TargetName"]) ; 
            if ( ctl != null ) 
                var keyframe = animation.KeyFrames.GetItem(animation.KeyFrames.Count-1); 
                ctl["Canvas.Left"] = keyframe.value ; 
        } , 
    Now the value is maintained...   storyboard is stopped so it is reusable..

    A sample (including source) for these snippets is here...  
    for instructions:

    1. Click on any rectangle to see it animate..
    2. The demo begins with "Hold" checked because that is default behavior ( FillBehavior=HoldEnd)
    3. Click on the "stop animation before starting new one" to get around the AG_E_RUNTIME_SETVALUE
    4. Click on the "HoldEnd" to see the differences between  FillBehavior = HoldEnd  and FillBehavior = Stop
    5. Click on the "subscribe to event .. to set the value after animation has stopped"
  • Jaime Rodriguez

    world aids day is today...


    Most of the time I live in a 'shoe box' not knowing what is going on outside of my family and work; today is one of these days: I totally missed World AIDS Day concert.

    Beyond the concert, to me the day is a reminder of AIDS realities:

    • There are millions of people suffering from it; a lot of these are innocent children born with the disease to an already troubled family and troubled socioeconomic crisis.
    • This is a fast growing epidemic; I have been lucky to not know any one directly affected but that is likely to change if we don't get it under control (prevention, treatment and hopefully a cure). 

    Any way, it is AIDS day.. no matter when you are reading this .. it is good to think about that reality once a year (at least)
    [For those expecting usual techno ramble, will be back to scheduling programming tomorrow. Apologies in advance for the personal detour]


Page 1 of 1 (8 items)