示例#1
0
        public FlowSwitchCaseEditorDialog(ModelItem activity, EditingContext context, DependencyObject owner, string title, Type genericType)
        {
            this.WindowSizeToContent = SizeToContent.Manual;
            this.ModelItem           = activity;
            this.Context             = context;
            this.Owner            = owner;
            this.Title            = title;
            this.genericType      = genericType;
            this.WindowResizeMode = ResizeMode.NoResize;
            this.MinWidth         = 300;
            this.MaxWidth         = 300;
            this.MinHeight        = 120;
            this.MaxHeight        = 120;

            caseKeyBox = new CaseKeyBox()
            {
                DisplayHintText            = true,
                Visibility                 = Visibility.Visible,
                ValueType                  = genericType,
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment          = VerticalAlignment.Center,
                Width            = Double.NaN,
                CommitExplicitly = true,
                LabelText        = StringResourceDictionary.Instance.GetString("addCaseLabel"),
            };
            caseKeyBox.ViewModel.DataTemplateName = CaseKeyBoxViewModel.BoxesTemplate;
            caseKeyBox.ViewModel.IsBoxOnly        = true;
            caseKeyBox.SetBinding(CaseKeyBox.ValueProperty, new Binding()
            {
                Source = this,
                Path   = new PropertyPath(FlowSwitchCaseEditorDialog.caseProperty),
                Mode   = BindingMode.TwoWay
            });
            caseKeyBox.CaseKeyValidationCallback = this.ValidateCaseKey;
            caseKeyBox.ValueCommitted           += (sender, e) =>
            {
                this.CloseDialog(true);
            };
            caseKeyBox.EditCancelled += (sender, e) =>
            {
                this.CloseDialog(false);
            };

            this.Content = caseKeyBox;

            this.OnOk = () =>
            {
                caseKeyBox.CommitChanges();
                return(false);    // ValueCommitted event handler will handle CloseDialog
            };
        }
        public FlowSwitchCaseEditorDialog(ModelItem activity, EditingContext context, DependencyObject owner, string title, Type genericType)
        {
            this.WindowSizeToContent = SizeToContent.Manual;
            this.ModelItem = activity;
            this.Context = context;
            this.Owner = owner;
            this.Title = title;
            this.genericType = genericType;
            this.WindowResizeMode = ResizeMode.NoResize;
            this.MinWidth = 300;
            this.MaxWidth = 300;
            this.MinHeight = 120;
            this.MaxHeight = 120;

            caseKeyBox = new CaseKeyBox()
            {
                DisplayHintText = true,
                Visibility = Visibility.Visible,
                ValueType = genericType,
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Center,
                Width = Double.NaN,
                CommitExplicitly = true,
                LabelText = StringResourceDictionary.Instance.GetString("addCaseLabel"),
            };
            caseKeyBox.ViewModel.DataTemplateName = CaseKeyBoxViewModel.BoxesTemplate;
            caseKeyBox.ViewModel.IsBoxOnly = true;
            caseKeyBox.SetBinding(CaseKeyBox.ValueProperty, new Binding()
            {
                Source = this,
                Path = new PropertyPath(FlowSwitchCaseEditorDialog.caseProperty),
                Mode = BindingMode.TwoWay
            });
            caseKeyBox.CaseKeyValidationCallback = this.ValidateCaseKey;
            caseKeyBox.ValueCommitted += (sender, e) =>
                {
                    this.CloseDialog(true);
                };
            caseKeyBox.EditCancelled += (sender, e) =>
                {
                    this.CloseDialog(false);
                };

            this.Content = caseKeyBox;

            this.OnOk = () =>
                {
                    caseKeyBox.CommitChanges();
                    return false; // ValueCommitted event handler will handle CloseDialog
                };
        }
示例#3
0
 private void OnNewTransitionUnloaded(object sender, RoutedEventArgs e)
 {
     this.addNewTransitionBox = null;
 }
示例#4
0
 private void OnNewTransitionLoaded(object sender, RoutedEventArgs e)
 {
     this.addNewTransitionBox = (CaseKeyBox)sender;
 }
示例#5
0
 void OnCaseKeyBoxLoaded(object sender, RoutedEventArgs e)
 {
     this.caseKeyBox = (CaseKeyBox)sender;
 }
 void OnCaseKeyBoxLoaded(object sender, RoutedEventArgs e)
 {
     this.caseKeyBox = (CaseKeyBox)sender;
 }
 private void OnNewTransitionUnloaded(object sender, RoutedEventArgs e)
 {
     this.addNewTransitionBox = null;
 }
 private void OnNewTransitionLoaded(object sender, RoutedEventArgs e)
 {
     this.addNewTransitionBox = (CaseKeyBox)sender;
 }