Example #1
0
        private ReportDialog(string title, string message)
            : base(title, INTV.Shared.Utility.SingleInstanceApplication.Instance.MainWindow, Gtk.DialogFlags.Modal)
        {
            var viewModel = new ReportDialogViewModel();

            viewModel.PropertyChanged += HandlePropertyChanged;
            DataContext = viewModel;
            this.Build();
            _message.SizeAllocated += HandleSizeAllocated;

            if (title != null)
            {
                viewModel.Title = title;
            }
            if (message != null)
            {
                viewModel.Message = message;
            }
            var propertiesToUpdate = new[]
            {
                ReportDialogViewModel.TitlePropertyName,
                ReportDialogViewModel.MessagePropertyName,
                ReportDialogViewModel.CloseDialogButtonTextPropertyName,
                ReportDialogViewModel.CloseDialogButtonEnabledPropertyName,
                ReportDialogViewModel.ShowCopyToClipboardButtonPropertyName,
                ReportDialogViewModel.DoNotShowAgainTextPropertyName,
                ReportDialogViewModel.ShowDoNotShowAgainPropertyName,
                ReportDialogViewModel.SendEmailButtonLabelTextPropertyName,
                ReportDialogViewModel.ShowSendEmailButtonPropertyName,
                ReportDialogViewModel.SendEmailEnabledPropertyName,
                ////ReportDialogViewModel.EmailSenderPropertyName,
                ReportDialogViewModel.HasAttachmentsPropertyName,
            };

            foreach (var propertyName in propertiesToUpdate)
            {
                HandlePropertyChanged(viewModel, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
 /// <summary>Shared initialization code.</summary>
 private void Initialize()
 {
     DialogDataContext = new ReportDialogViewModel();
     DialogDataContext.PropertyChanged += HandlePropertyChanged;
 }
Example #3
0
 public ReportDialog(MeetingNotes meetingNotes) : this()
 {
     DataContext = new ReportDialogViewModel(this, meetingNotes);
 }