简体   繁体   English

美元-通过FireRequestAction传递数据

[英]USD - Pass Data through FireRequestAction

I am stuck in this small issue and as I am new to Microsoft usd therefore I require a bit of help to go through this. 我被困在这个小问题上,由于我是Microsoft us的新手,因此我需要一些帮助来解决这个问题。

I am trying to pass data from my Xaml.cs code inside USD Action Call but I am unable to do it. 我正在尝试通过USD Action Call中的 Xaml.cs代码传递数据,但无法执行此操作。 I have tried many solutions, below are some. 我尝试了许多解决方案,以下是一些解决方案。

Object actionData;
 actionData = "CustomerID =D*****-****-****-****-***********";
 actionData = GeneralFunctions.Serialize(actionData);
 FireRequestAction(new RequestActionEventArgs(USDHostedControl, USDAction, actionData));

I have also tried like below, 我也尝试过如下

 actionData = new Dictionary<string, string> { { "CustomerID", "D*****-****-****-****-***********" }};
  actionData = GeneralFunctions.Serialize(actionData);
  FireRequestAction(new RequestActionEventArgs(USDHostedControl, USDAction, actionData));

And inside my USD Action Call I am passing like this, 在我的美元行动通知内,我像这样传递

customerid=[[CustomerID]]

But unfortunately, none of it is working. 但不幸的是,它们都没有起作用。 I hope anyone here can help me with this. 我希望这里的任何人都能帮助我。

Many thanks in advance. 提前谢谢了。

Try this, 尝试这个,

var ctx= Context.GetContext();
var context = new Context(ctx);
context["CustomerID"] = "D*****-****-****-****-***********"";
FireRequestAction(new RequestActionEventArgs(USDHostedControl, USDAction, context));

And then inside your Action Call get the value using $Context. 然后在Action Call中使用$ Context获取值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM