I solved my problem by exposing variables from widgets and passing it through casting. Thanks by the way.