Example #1
0
            /// <summary>
            /// Displays the Export Z80 Code dialog to collect parameter data
            /// </summary>
            /// <param name="vm">View model with collected data</param>
            /// <returns>
            /// True, if the user stars export; false, if the export is cancelled
            /// </returns>
            private bool AddVmStateParameterDialog(out AddVmStateViewModel vm)
            {
                var exportDialog = new AddVmStateDialog
                {
                    HasMaximizeButton = false,
                    HasMinimizeButton = false
                };

                var filename = $"VmState_{DateTime.Now:yyyy_mm_dd_HH_MM_ss}.vmstate";

                vm = new AddVmStateViewModel
                {
                    Filename = filename
                };
                exportDialog.SetVm(vm);
                var accepted = exportDialog.ShowModal();

                if (!accepted.HasValue || !accepted.Value)
                {
                    return(true);
                }
                return(false);
            }
Example #2
0
 /// <summary>
 /// Sets the view model of this dialog
 /// </summary>
 /// <param name="vm"></param>
 public void SetVm(AddVmStateViewModel vm)
 {
     DataContext = Vm = vm;
 }