Esempio n. 1
0
 void SetModel(BlueprintManagerDialogModel viewModel)
 {
     Host.DataContext             = viewModel;
     viewModel.DeletingBlueprint += OnDeletingBlueprint;
     viewModel.MessageRequested  += OnMessageRequested;
     viewModel.Closing           += OnModelClosing;
 }
Esempio n. 2
0
        /// <summary>
        /// Shows this dialog with the provided view model.
        /// </summary>
        /// <param name="viewModel"></param>
        /// <returns></returns>
        public static bool?ShowDialog(BlueprintManagerDialogModel viewModel)
        {
            var dialog = new BlueprintManagerDialog();

            dialog.SetModel(viewModel);
            return(dialog.ShowModal());
        }
Esempio n. 3
0
 /// <summary>
 /// Creates a new instance of the blueprint model
 /// </summary>
 /// <param name="manager"></param>
 /// <param name="thumbnail"></param>
 /// <param name="directory"></param>
 /// <param name="isSignificant"></param>
 public BlueprintModel([NotNull] BlueprintManagerDialogModel manager, ImageSource thumbnail, [NotNull] DirectoryInfo directory, bool isSignificant)
 {
     Manager       = manager ?? throw new ArgumentNullException(nameof(manager));
     Thumbnail     = thumbnail;
     Directory     = directory ?? throw new ArgumentNullException(nameof(directory));
     Name          = Directory.Name;
     IsSignificant = isSignificant;
 }