protected void OnSaveApplyTemplate(object sender, RoutedEventArgs e) { EditorOverlay mainEditor = EditorOverlay.Current; LayoutModel model = mainEditor.DataContext as LayoutModel; if (model != null) { model.Persist(mainEditor.GetZoneRects()); } _choosing = true; this.Close(); EditorOverlay.Current.Close(); }
private void Apply_Click(object sender, RoutedEventArgs e) { EditorOverlay mainEditor = EditorOverlay.Current; if (mainEditor.DataContext is LayoutModel model) { if (model is GridLayoutModel) { model.Apply(mainEditor.GetZoneRects()); } else { model.Apply((model as CanvasLayoutModel).Zones.ToArray()); } Close(); } }