private static void Show(ManageLayoutsViewModel dataContext, IWindowLayoutSettings settings = null) { Validate.IsNotNull(dataContext, "DataContext"); var manageLayoutsDialog = new ManageLayoutsDialog(); if (settings != null) { var layoutsDialogWidth = settings.ManageLayoutsDialogWidth; if (layoutsDialogWidth != 0) { manageLayoutsDialog.Width = layoutsDialogWidth; } var layoutsDialogHeight = settings.ManageLayoutsDialogHeight; if (layoutsDialogHeight != 0) { manageLayoutsDialog.Height = layoutsDialogHeight; } } manageLayoutsDialog.DataContext = dataContext; dataContext.Layouts.CollectionChanged += manageLayoutsDialog.OnLayoutsCollectionChanged; try { manageLayoutsDialog.ShowModal(); } finally { dataContext.Layouts.CollectionChanged -= manageLayoutsDialog.OnLayoutsCollectionChanged; } if (settings == null) { return; } settings.ManageLayoutsDialogWidth = (int)manageLayoutsDialog.Width; settings.ManageLayoutsDialogHeight = (int)manageLayoutsDialog.Height; }
public static IEnumerable <KeyValuePair <string, WindowLayout> > ShowManageLayoutsView(IEnumerable <KeyValuePair <string, WindowLayout> > layoutKeyInfoCollection) { return(ManageLayoutsDialog.Show(layoutKeyInfoCollection)); }