Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 public static IEnumerable <KeyValuePair <string, WindowLayout> > ShowManageLayoutsView(IEnumerable <KeyValuePair <string, WindowLayout> > layoutKeyInfoCollection)
 {
     return(ManageLayoutsDialog.Show(layoutKeyInfoCollection));
 }