Commits

Christian Specht committed c15d1fd Draft

shorten RelayCommand usage

Comments (0)

Files changed (2)

src/MissileSharp.Launcher/ViewModels/MainWindowViewModel.cs

 
         public ObservableCollection<string> CommandSets { get; set; }
 
-        public ICommand FireCommand { get; set; }
+        public ICommand FireCommand
+        {
+            get { return new RelayCommand(this.FireMissile); }
+        }
 
         public MainWindowViewModel(ICommandCenterService commandCenterService, IConfigService configService, IMessageService messageService, IShutdownService shutdownService)
         {
 
         public void Initialize()
         {
-            this.FireCommand = new RelayCommand(new Action<object>(this.FireMissile));
-
             try
             {
                 this.model = this.commandCenterService.GetCommandCenter();

src/MissileSharp.Launcher/ViewModels/MessageBoxWindowViewModel.cs

 
         public ICommand CloseCommand
         {
-            get
-            {
-                return new RelayCommand(o => ((Window)o).Close());
-            }
+            get { return new RelayCommand(o => ((Window)o).Close()); }
         }
     }
 }