I have control like this
<UserControl x:Class="VideoControl.VideoControl" Loaded="getProperty"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
</UserControl>
And i have method like this
private void getProperty(object sender, RoutedEventArgs e) {
var objContext = (IContentItem)this.DataContext;
var Scrn = (Microsoft.LightSwitch.Client.IScreenObject)objContext.Screen;
var anonObject = Scrn.Details.Properties["VidContentItemRessourcesItem"].Value;
string result= anonObject.GetType().GetProperty("AssetPubLocator").GetValue(anonObject, null).ToString();
}
but when i run this, object result is null becouse predefined Loaded silverlight function is called before lightswitch screen is loaded, when i call method get property on button click result isnt null becouse lightswitch screen is loaded. So my question is how to call this method after screen is loaded in some pritty way ( no button click).