Commits

Christian Specht committed 371910f Draft

new button to close the MessageBoxWindow

  • Participants
  • Parent commits 024f976

Comments (0)

Files changed (2)

src/MissileSharp.Launcher/ViewModels/MessageBoxWindowViewModel.cs

-
+using System.Windows;
+using System.Windows.Input;
+
 namespace MissileSharp.Launcher.ViewModels
 {
     public class MessageBoxWindowViewModel : BaseViewModel
                 OnPropertyChanged("MessageText");
             }
         }
+
+        public ICommand CloseCommand
+        {
+            get
+            {
+                return new RelayCommand(o => ((Window)o).Close());
+            }
+        }
     }
 }

src/MissileSharp.Launcher/Views/MessageBoxWindow.xaml

         ShowIconOnTitleBar="true">
     <Grid>
         <TextBlock Margin="5" Text="{Binding MessageText}" />
+        <Button 
+            Content="OK"
+            Command="{Binding CloseCommand}"
+            CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
+            Height="30"
+            Margin="5"
+            VerticalAlignment="Bottom"
+            />
     </Grid>
 </Controls:MetroWindow>