Пример #1
0
        protected override void OnContextMenuOpening(ContextMenuEventArgs e)
        {
            var parentContentPane = FindDependencyParent.FindParent <DesignerView>(this);
            var dataContext       = parentContentPane?.DataContext;

            if (dataContext != null)
            {
                if (dataContext.GetType().Name == "ServiceTestViewModel" || dataContext.GetType().Name == "MergeWorkflowViewModel")
                {
                    e.Handled = true;
                }
                else
                {
                    base.OnContextMenuOpening(e);

                    if (ViewModel != null && ViewModel.HasLargeView && !ViewModel.ShowSmall && ViewModel.ShowSmall)
                    {
                        var imageSource = ImageAwesome.CreateImageSource(FontAwesomeIcon.Expand, Brushes.Black);
                        var icon        = new Image
                        {
                            Source = imageSource,
                            Height = 14,
                            Width  = 14
                        };
                        _showCollapseLargeView.Header = "Show Large View";
                        _showCollapseLargeView.Icon   = icon;
                    }
                }
            }
        }
Пример #2
0
        void OnDtoPropertyChanged(object sender, PropertyChangedEventArgs args)
        {
            if (!IsMerge)
            {
                DoCustomAction(args.PropertyName);
                if (args.PropertyName != "CanRemove")
                {
                    return;
                }

                var canAdd = true;
                var parent = ModelItemCollection.Parent;
                if (parent != null)
                {
                    var parentContentPane = FindDependencyParent.FindParent <DesignerView>(parent.View);
                    var dataContext       = parentContentPane?.DataContext;
                    if (dataContext != null && (dataContext.GetType().Name == "ServiceTestViewModel"))
                    {
                        canAdd = false;
                    }
                }

                if (canAdd)
                {
                    AddBlank(sender);
                }
            }
        }
        private bool UpdateContentEnabled()
        {
            DesignerView parentContentPane = FindDependencyParent.FindParent <DesignerView>(this);
            var          dataContext       = parentContentPane?.DataContext;

            if (dataContext != null)
            {
                if (dataContext.GetType().Name == "ServiceTestViewModel")
                {
                    if (ContentDesignerTemplate != null)
                    {
                        if (ContentDesignerTemplate.Parent.GetType().Name != "ForeachDesigner" &&
                            ContentDesignerTemplate.Parent.GetType().Name != "SequenceDesigner" &&
                            ContentDesignerTemplate.Parent.GetType().Name != "SelectAndApplyDesigner")
                        {
                            ContentDesignerTemplate.IsEnabled = false;
                        }
                        ContentDesignerTemplate.RightButtons.Clear();
                        ContentDesignerTemplate.LeftButtons.Clear();
                    }
                }
                return(true);
            }
            return(false);
        }
Пример #4
0
        bool IsServiceTestContentEnabled()
        {
            var parentContentPane = FindDependencyParent.FindParent <DesignerView>(this);
            var dataContext       = parentContentPane?.DataContext;

            if (dataContext != null)
            {
                UpdateServiceTest(dataContext);

                return(true);
            }
            return(false);
        }
Пример #5
0
        void UpdateContentEnabled()
        {
            var parentContentPane = FindDependencyParent.FindParent <DesignerView>(this);
            var dataContext       = parentContentPane?.DataContext;

            if (dataContext != null)
            {
                UpdateServiceTest(dataContext);

                if (dataContext.GetType().Name == "MergeWorkflowViewModel")
                {
                    ViewModel.IsMerge = true;
                }
            }
        }
Пример #6
0
        void ToggleTitleBarVisibility()
        {
            DesignerView parentContentPane     = FindDependencyParent.FindParent <DesignerView>(ModelItem.View);
            var          dataContext           = parentContentPane?.DataContext;
            var          isSelectedOrMouseOver = IsSelectedOrMouseOver;

            if (dataContext != null && dataContext.GetType().Name == "ServiceTestViewModel")
            {
                TitleBarTogglesVisibility = Visibility.Collapsed;
            }
            else
            {
                TitleBarTogglesVisibility = isSelectedOrMouseOver ? Visibility.Visible : Visibility.Collapsed;
                ZIndexPosition            = isSelectedOrMouseOver ? ZIndexPosition.Front : ZIndexPosition.Back;
            }
        }
        void OnDtoPropertyChanged(object sender, PropertyChangedEventArgs args)
        {
            DoCustomAction(args.PropertyName);
            if (args.PropertyName != "CanRemove")
            {
                return;
            }

            bool canAdd = true;
            var  parent = ModelItemCollection.Parent;

            if (parent != null)
            {
                DesignerView parentContentPane = FindDependencyParent.FindParent <DesignerView>(parent.View);
                var          dataContext       = parentContentPane?.DataContext;
                if (dataContext != null)
                {
                    if (dataContext.GetType().Name == "ServiceTestViewModel")
                    {
                        canAdd = false;
                    }
                }
            }

            if (canAdd)
            {
                var dto = (TDev2TOFn)sender;
                if (dto.CanAdd())
                {
                    if (ModelItemCollection.Count == 2)
                    {
                        var firstDto = GetDto(1);
                        if (!firstDto.CanRemove())
                        {
                            // first row is not blank
                            AddBlankRow();
                        }
                    }
                    else
                    {
                        AddBlankRow();
                    }
                }
            }
        }