Пример #1
0
        public virtual IWindow CreateChild(object viewModel)
        {
            var cw = new ContentWindow();
            cw.Owner = this.wpfWindow;
            cw.DataContext = viewModel;
            WindowAdapter.ConfigureBehavior(cw);

            return new WindowAdapter(cw);
        }
Пример #2
0
 private static void ConfigureBehavior(ContentWindow cw)
 {
     cw.WindowStartupLocation = WindowStartupLocation.CenterOwner;
     cw.CommandBindings.Add(new CommandBinding(PresentationCommands.Accept, (sender, e) => cw.DialogResult = true));
 }