It does not take ref key word

It works fine in command line, but does not work on UWP application
TextSearch.ResultCode code = txt_search.Run(ref page_num, ref result_str, ref ambient_string, hlts );

It was new to me, but now ref type declare something like this.
Int32Ref pageNum = new Int32Ref(0);
StringRef result_str = new StringRef("");

Hello Agha,

Thank you for reaching out and we will make sure to improve our documentation to make it clearer the implementation in UWP.

You can also check the UWP TextSearch sample for future reference: