Hi,
I'm new to silverlight and telerik. I'm trying to display some data that i got from calling a webservice on the tooltip. I can assign the data on tooltip inside function
I'm new to silverlight and telerik. I'm trying to display some data that i got from calling a webservice on the tooltip. I can assign the data on tooltip inside function
"Reader_PreviewReadCompleted". However, this function gets called before I get my data from webservice. So, what I am thinking is to get a hold of MapShape items at the end of my webservice call to assign data.. how do i do that..?
public
MainPage()
{
InitializeComponent();
....
Proxy.ListsSoapClient proxy =
new
Proxy.ListsSoapClient(basicHttpBinding, endpointAddress);
proxy.GetListItemsCompleted +=
new
EventHandler<SpProxy.GetListItemsCompletedEventArgs>(proxy_GetListItemsCompleted);
proxy.GetListItemsAsync(ListGuid,
null
, query, viewFields,
null
, queryOptions,
null
);
}
void
proxy_GetListItemsCompleted(
object
sender, SpProxy.GetListItemsCompletedEventArgs e)
{
...
// I receive my data inside this function
myListset.Add(nItem); // I can assign my data to MapShape items at this point..?
}
}
private
void
MapShapeReader_PreviewReadCompleted(
object
sender, Telerik.Windows.Controls.Map.PreviewReadShapesCompletedEventArgs eventArgs)
{
if
(eventArgs.Error ==
null
)
{
foreach
(MapShape shape
in
eventArgs.Items)
{
ExtendedData extendedData = shape.ExtendedData;
if
(extendedData !=
null
)
{
string
countryName = (
string
)shape.ExtendedData.GetValue(
"CNTRY_NAME"
);
if
(countryName ==
"United States"
)
{
ExtendedPropertySet propertySet =
new
ExtendedPropertySet();
propertySet.RegisterProperty(
"Data"
,
"Data"
,
typeof
(
string
),
string
.Empty);
ExtendedData usaData =
new
ExtendedData(propertySet);
usaData.SetValue(
"Data"
,
"sample data"
);
shape.ExtendedData = usaData;
ToolTip tooltip =
new
ToolTip();
Binding tooltipBinding =
new
Binding()
{
Converter =
new
ExtendedDataConverter(),
ConverterParameter =
"{Data}"
,
Source = shape.ExtendedData
};
tooltip.SetBinding(ToolTip.ContentProperty, tooltipBinding);
ToolTipService.SetToolTip(shape, tooltip);
}
}
}
}
}