private async void OnGeneratePayload(object obj)
        {
            var payloadReq = new PayloadRequest
            {
                ListenerId      = SelectedListener.Split(":")[0].TrimEnd(),
                OutputType      = OutputType.Dll,
                SleepInterval   = SleepInterval,
                SleepJitter     = SleepJitter,
                KillDate        = KillDate,
                TargetFramework = TargetFramework.Net40
            };

            if (SelectedFormat == Formats[0])
            {
                payloadReq.OutputType = OutputType.Exe;
            }

            var window = new Window
            {
                Height = 100,
                Width  = 360,
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
                Content = new ProgressBarView {
                    DataContext = new ProgressBarViewModel {
                        Label = "Building..."
                    }
                }
            };

            window.Show();

            var payload = await PayloadAPI.GenerateAgentPayload(payloadReq);

            window.Close();

            if (payload.Length > 0)
            {
                var save = new SaveFileDialog();

                if (SelectedFormat == Formats[0])
                {
                    save.Filter = "EXE (*.exe)|*.exe";
                }
                else if (SelectedFormat == Formats[1])
                {
                    save.Filter = "DLL (*.dll)|*.dll";
                }

                if ((bool)save.ShowDialog())
                {
                    File.WriteAllBytes(save.FileName, payload);
                }
            }

            View.Close();
        }