gpt4 book ai didi

workflow-foundation-4 - 如何将 WorkflowActivityDesigner 中的复选框和下拉菜单绑定(bind)到 CodeActivity 中的参数?

转载 作者:行者123 更新时间:2023-12-02 04:54:42 25 4
gpt4 key购买 nike

如何将 WorkflowActivityDesigner 中的复选框和下拉菜单绑定(bind)到 CodeActivity 中的参数?我终于能够使用这个将设计器与事件联系起来:[Designer(typeof(ActivityDesigner1))]。但问题仍然存在,我如何将设计器表面的值消耗到

这是我的代码事件文件:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.ComponentModel;

namespace WorkflowConsoleApplication1
{
[Designer(typeof(ActivityDesigner1))]
public sealed class CodeActivity1 : NativeActivity
{
// Define an activity input argument of type string
public InArgument<string> Text { get; set; }

protected override void Execute(NativeActivityContext context)
{
string text = context.GetValue(this.Text);
Console.WriteLine(this.Text);
}
}
}

这是我的设计器 xaml 文件:

<sap:ActivityDesigner x:Class="WorkflowConsoleApplication1.ActivityDesigner1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation" Height="68">
<sap:ActivityDesigner.Icon>
<DrawingBrush>
<DrawingBrush.Drawing>
<ImageDrawing>
<ImageDrawing.Rect>
<Rect Location="0,0" Size="16,16" />
</ImageDrawing.Rect>
<ImageDrawing.ImageSource>
<BitmapImage UriSource="TES16x16icon.gif" />
</ImageDrawing.ImageSource>
</ImageDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</sap:ActivityDesigner.Icon>
<Grid>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<TextBox HorizontalAlignment="Left" Height="21" Margin="34,6,0,-18" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120" Name="txtSubject" RenderTransformOrigin="0.5,0.5">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-5.46"/>
<TranslateTransform/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>

</Grid>
</sap:ActivityDesigner>

最佳答案

关于workflow-foundation-4 - 如何将 WorkflowActivityDesigner 中的复选框和下拉菜单绑定(bind)到 CodeActivity 中的参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24100274/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com