/// <summary>
 /// Initializes a new instance of the <see cref="MainWindowCommandModel"/> class.
 /// </summary>
 /// <param name="mainWindowViewModel">The main window view model.</param>
 /// <param name="mainWindow">The main window of the application.</param>
 public MainWindowCommandModel(MainWindowViewModel mainWindowViewModel, IMainWindow mainWindow)
 {
     //this.mainWindowViewModel = mainWindowViewModel;
     //this.mainWindow = mainWindow;
     //this.mainWorkArea = mainWindow.Designer;
     this.WorkAreaCommands = new WorkAreaCommands(mainWindowViewModel, mainWindow.WorkArea);
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GeneralCommandsModel"/> class.
 /// </summary>
 /// <param name="mainwindowViewmodel">The main window <see cref="ViewModel"/>.</param>
 /// <param name="mainWindow">The main window.</param>
 public GeneralCommandsModel(
     /*ApplicationViewModel applicationViewModel,*/
     MainWindowViewModel mainwindowViewmodel,
     IMainWindow mainWindow)
 {
     // this.applicationViewModel = applicationViewModel;
     this.mainWindow = mainWindow;
     this.mainwindowViewmodel = mainwindowViewmodel;
     mainWindow.Initialized += this.MainWindowInitialized;
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:WorkAreaCommands"/> class.
 /// </summary>
 /// <param name="mainWindowViewModel">The main window view model.</param>
 /// <param name="workArea">The work area of the main window.</param>
 public WorkAreaCommands(MainWindowViewModel mainWindowViewModel, IMainWorkArea workArea)
 {
     this.workArea = workArea;
     this.mainWindowViewModel = mainWindowViewModel;
 }
Example #4
0
        /// <summary>
        /// Provides a deterministic way to create the Main property.
        /// </summary>
        public static void CreateMain()
        {
            if (_main == null)
            {
                try
                {
                    var bla = container.ResolveAll<BackupDataRepository>();
                    var blax = container.Resolve<IDings>();
                    var factory = container.Resolve<IDingsFactory>();
                    var dings = factory.Create();

                    //TaskContext.Default = container.Resolve<ITaskService>();
                    //var tskcontext = container.Resolve<TaskContext>("TaskContext");

                    //TaskContext.Default = container.Resolve<TaskContext>();
                    _main = container.Resolve<MainWindowViewModel>();
                }
                catch(Exception e)
                {
                    if(MainWindowViewModel.IsInDesignModeStatic)
                    {
                        var msg = e.Message  + Environment.NewLine;
                        //msg += e.StackTrace + Environment.NewLine;
                        var inner = e.InnerException;
                        if(inner != null)
                            msg += inner.Message + Environment.NewLine;
                        inner = inner.InnerException ;
                        if(inner != null)
                        {
                            msg += inner.Message + Environment.NewLine;
                            msg += inner.StackTrace + Environment.NewLine;
                        }
                        /*inner = inner.InnerException;
                        if(inner != null)
                            msg += inner.Message + Environment.NewLine;
                        inner = inner.InnerException;
                        if(inner != null)
                            msg += inner.Message + Environment.NewLine;
                        inner = inner.InnerException;
                        if(inner != null)
                            msg += inner.Message + Environment.NewLine;*/

                        MessageBox.Show(msg);
                    }
                    else
                        throw;
                }
            }
        }
Example #5
0
 /// <summary>
 /// Provides a deterministic way to delete the Main property.
 /// </summary>
 public static void ClearMain()
 {
     if (_main != null)
     {
         _main.Cleanup();
         _main = null;
     }
 }
Example #6
0
 /// <summary>
 /// Cleans this instance up.
 /// </summary>
 public void CleanUp()
 {
     this.mainwindowViewmodel = null;
     this.mainWindow = null;
 }