1. Christian Specht
  2. MissileSharp

Commits

Christian Specht  committed c15d1fd Draft

shorten RelayCommand usage

  • Participants
  • Parent commits 371910f
  • Branches default

Comments (0)

Files changed (2)

File src/MissileSharp.Launcher/ViewModels/MainWindowViewModel.cs

View file
 
         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();

File src/MissileSharp.Launcher/ViewModels/MessageBoxWindowViewModel.cs

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