private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { EditablePopup ctrl = (EditablePopup)d; if ((bool)e.NewValue) { if (ctrl._parentPopup == null) { ctrl.HookupParentPopup(); } } }
//Create an EditablePopup for each image. void CreateDescriptions() { berlinDesc = new EditablePopup(); berlinDesc.Text = "Title:\tBerlin, Germany\n" + "Description:\n\tBrandenburg Gate."; berlinDesc.PlacementTarget = berlinPic; budapestDesc = new EditablePopup(); budapestDesc.Text = "Title:\tBudapest, Hungary\n" + "Description:\n\tHungarian Parliament Building and the Danube River"; budapestDesc.PlacementTarget = budapestPic; dresdenDesc = new EditablePopup(); dresdenDesc.Text = "Title:\tDresden, Germany\n" + "Description:\n\tZwinger Palace"; dresdenDesc.PlacementTarget = dresdenPic; pragueDesc = new EditablePopup(); pragueDesc.Text = "Title:\tPrague, Czech Republic\n" + "Description:\n\tView from the Prague Castle."; pragueDesc.PlacementTarget = praguePic; }