Combining Script with DataAction

I have the following in a script:
App.PushPage(“livingroku.xaml”);
App.SetDeviceAttribute(“subpage”, “ftv1”);

I added a Roku media command in the data action but it doesn’t execute. If I remove the script, it executes. If I remove the data action and put it as a line of code in the script, it executes. Do scripts and DataActions not work together?

They should. When possible, try to avoid scripts in XAML. Use DataActions or MethodActions. Your app will perform better. In the 3.5.0 release, Conditions were added to Actions which should help eliminate the need for scripting.

1 Like