He says in his best maniacal voice…
I assume you know that the fairly recent movie “When a Stranger Calls” is a re-make of the 1979 original which starred Carol Kane as the babysitter. You may remember Carol Kane as Simka, Latka Gravas’ (Andy Kaufman) wife in the TV show Taxi. Andy’s dead now you know…sad really…he kind of went off the deep end when he started wrestling women…
Blog reader: What the hell are you talking about?
Sorry, my mind wanders like that from time to time. Don’t know if it’s because I’m a product of the 60’s or if I’m just getting old or that I’m just plain out of my FREAKIN’ gourd!
Okay, I’m better now. So anyway, I wanted to give you a heads up that there is a breaking change coming in the Crossbow API for Beta2. There used to be a Children property on WindowsFormsHost control. You would use the property to add your subsequent Windows Forms control to the host via the Children.Add() method. We’ll it ain’t there anymore. We replaced it with a Child property. This was done because we felt it was kinda stupid to have a collection property that limited you to one item. (You may remember that even though we implemented this property as a collection, we enforced a limitation of a single item in the collection). So now there’s just the single Child property and you simply assign some Windows Forms control to it.
WindowsFormsHost host = new WindowsFormsHost();
System.Windows.Forms.Button wfButton = new System.Windows.Forms.Button();
wfButton.Text = “WFButton”;
host.Child = wfButton;
Likewise on the ElementHost control, we used to have the Controls collection property where you added your single top-level element. Now we have replaced that with a Child property as well. Once again, we just wanted to remove the collection and replace it with a singleton and maintained consistency with the naming.
ElementHost host = new ElementHost();
System.Windows.Controls.Button wpfButton = new System.Windows.Controls.Button();
wpfButton.Content = “WPFButton”;
host.Child = wpfButton;
Note that this change goes into effect in the Beta2 drop of Crossbow.
So next time when the compiler calls and tells you something’s wrong…remember to check the children…