public ProgressWindow(Window owner = null)
 {
     InitializeComponent();
     if (owner != null)
     {
         Owner = owner;
     }
     DataContext = Data;
     PropertyChangedObject.RegisterWindow(this);
     Loaded += (sender, args) => { DataContext = Data; };
 }
Example #2
0
 public MainWindow()
 {
     ModifyProvider = new DelegateInteractionProvider <IModifyObjectInteraction>(() => new ModifyObjectWindow(this));
     InitializeComponent();
     PropertyChangedObject.RegisterWindow(this);
     DataContextChanged += OnDataContextChanged;
     DataContext         = new MainWindowViewModel();
     _pageViewerFactory  = new UniqueWindowFactory <PageCollectionViewerWindow>(() => new PageCollectionViewerWindow((MainWindowViewModel)DataContext), this, hideInsteadOfClose: true);
     Canvas.DefaultDrawingAttributes.FitToCurve = true;
     ContentRendered += (_, __) =>
     {
         Dispatcher.BeginInvoke(new Action(() =>
         {
             foreach (var error in App.ErrorQueue)
             {
                 MessageBox.Show(this, error, ErrorResources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
             }
         }), DispatcherPriority.ApplicationIdle);
     };
 }