Exemplo n.º 1
0
        private void SaveLayouts(SaveLayoutCommand cmd)
        {
            if (cmd.ViewModel.GetType() != typeof(ActivitiesViewModel))
            {
                return;
            }

            ControlLayoutManager.SaveControlLayout(allActivitiesGrid.Name, allActivitiesGrid);
        }
Exemplo n.º 2
0
        private void ExecuteSaveLayoutCommand(object sender, ExecutedRoutedEventArgs e)
        {
            var dlg = new VistaSaveFileDialog
            {
                Filter           = LocalizedStrings.Str3584,
                DefaultExt       = "xml",
                RestoreDirectory = true
            };

            if (dlg.ShowDialog(Application.Current.GetActiveOrMainWindow()) != true)
            {
                return;
            }

            var cmd = new SaveLayoutCommand();

            cmd.SyncProcess(SelectedStrategy);

            if (!cmd.Layout.IsEmpty())
            {
                File.WriteAllText(dlg.FileName, cmd.Layout);
            }
        }