private static IInPlaceEditor GetInPlaceEditor(ItemsControl control) { IInPlaceEditor inPlaceEditor = null; var lastClickedElement = GetLastClickedElement(control) as DependencyObject; if (lastClickedElement != null) { inPlaceEditor = GetInPlaceEditor(lastClickedElement); } return(inPlaceEditor); }
/// <summary> /// Initialize the view model and all of the known feature page editors. /// </summary> /// <param name="description">The description of the program whose features are being edited.</param> /// <param name="inplaceEditor">The in-place editor hosting this editor. Used for lifetime control.</param> public void Initialize(ProgramDescription description, IInPlaceEditor inplaceEditor) { InPlaceEditor = inplaceEditor; Description = description; ShowRevertToDefault = false; switch (description.ProgramInformation.DataOrigin) { case ProgramInformationOrigin.UserDefined: case ProgramInformationOrigin.None: break; default: ShowRevertToDefault = true; break; } OriginalFeatures = description.Features.Clone(); EditFeatures = OriginalFeatures.Clone(); EditsPriorToRevertToDatabase = null; InitializeToEditFeatures(); }
private static void SetInPlaceEditor(DependencyObject control, IInPlaceEditor inPlaceEditor) { control.SetValue(InPlaceEditorProperty, inPlaceEditor); }