Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SendContentDialog.xaml.cs « Presentation « Activities « ServiceModel « System « System.Activities.Core.Presentation « System.Activities.Presentation « referencesource « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1954b73834aff81cf4baac39dacf9360c2644e3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//----------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
//----------------------------------------------------------------

namespace System.ServiceModel.Activities.Presentation
{
    using System.Activities.Presentation;
    using System.Activities.Presentation.Hosting;
    using System.Activities.Presentation.Model;
    using System.Activities.Presentation.View;
    using System.Diagnostics.CodeAnalysis;
    using System.Windows;
    using System.Windows.Input;

    partial class SendContentDialog : WorkflowElementDialog
    {
        public static readonly DependencyProperty ViewModelProperty =
            DependencyProperty.Register("ViewModel", typeof(ContentDialogViewModel<SendMessageContent, SendParametersContent>), typeof(SendContentDialog));

        SendContentDialog()
        {
            InitializeComponent();
        }

        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors",
            Justification = "This values must be set before this constructor complete to ensure ShowOkCancel() can consume that immediately")]
        SendContentDialog(ModelItem activity, EditingContext context, DependencyObject owner)
            : this()
        {
            this.ModelItem = activity;
            this.Context = context;
            this.HelpKeyword = HelpKeywords.MessageContentDialog;
            this.Owner = owner;
            this.ViewModel = new ContentDialogViewModel<SendMessageContent, SendParametersContent>(this.ModelItem);
            if (!this.Context.Items.GetValue<ReadOnlyState>().IsReadOnly)
            {
                this.OnOk = this.ViewModel.OnOk;
            }
        }

        public ContentDialogViewModel<SendMessageContent, SendParametersContent> ViewModel
        {
            get { return (ContentDialogViewModel<SendMessageContent, SendParametersContent>)GetValue(ViewModelProperty); }
            set { SetValue(ViewModelProperty, value); }
        }

        public static bool ShowDialog(ModelItem activity, EditingContext context, DependencyObject owner)
        {
            return new SendContentDialog(activity, context, owner).ShowOkCancel();
        }

        void OnDynamicArgumentDesignerLoaded(object sender, RoutedEventArgs args)
        {
            ((DynamicArgumentDesigner)sender).ParentDialog = this;
        }

        void OnExpressionTextBoxLoaded(object sender, RoutedEventArgs args)
        {
            ((ExpressionTextBox)sender).IsIndependentExpression = true;
        }
    }
}