Using init parameters instead of JavaScript

Mar 12, 2010 at 7:18 PM

I am trying to rewrite the Silverlight  to use init parameters instead of invoking the control with JavaScript.  My reasoning is that we would like to use the control where the user (non-programmer) can implement the control and set the bands and name the xml file from a web part tool box.  I am having some problems, I think with m_isJavascriptMode as I can see the xml file load but I don't see the time line bands or events.  My logic was to tap into the Scriptable Members of the control and set them via init parameters.  Here is a frag to do this:

       private void TimeLine_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            if (App.Current.Resources.Contains("Urls"))
            {
                //using only one xml file here
                Urls = App.Current.Resources["Urls"].ToString();
                UriInfo info;
                info = new UriInfo();
                info.Url = new Uri(Urls, UriKind.RelativeOrAbsolute);

                Timeline.Urls.Add(info);

            }
          
            }

 

These are set in App.xaml.cs  startup

 

<font size="2">

 

</font>

 

foreach (var item in

e.InitParams)

{

<font size="2">

 

</font>

 

this.Resources.Add(item.Key, item.Value);

}

<font size="2">

I do the same with all the other Scriptable members.  I have single stepped throught the code and these do get set.  The xml file loads, however, the events or bands do not render.  Any help would be appreciated!

 

</font>

 

 

 

 

Coordinator
Mar 13, 2010 at 12:14 AM

can you attach the solution in Issue Tracker? I guess you need to call ClearEvents/ResetEvents.