2014-09-19 70 views

回答

1

由于这里概述:http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868212.aspx

创建敬酒,使其具有launch参数:

((XmlElement)toastNode).SetAttribute("launch", "{\"type\":\"toast\",\"param1\":\"12345\",\"param2\":\"67890\"}"); 

的吐司XML将出现

<toast launch="{&quot;type&quot;:&quot;toast&quot;:&quot;param1&quot;:&quot;12345&quot;:&quot;param2&quot;:&quot;67890&quot;}">       
    <visual> 
     <binding template="ToastImageAndText01"> 
      <image id="1" src="ms-appx:///images/redWide.png" alt="red graphic"/> 
      <text id="1">Hello World!</text> 
     </binding> 
    </visual> 
</toast> 

然后在应用程序的OnLaunched方法:

protected override void OnLaunched(LaunchActivatedEventArgs args) 
{ 
    string launchString = args.Arguments 

    .... 
} 
相关问题