First of all, i don't know where to post this thread becuase there is no category for RadHtmlPlaceholder for Silverlight.
Issue is that i have declared an event for RadHtmlPlaceholder and it is not firing it's event... The thing is i want to get the coordinates when mouse is pressed. Also, how would i insert an image overlapping the HtmlPlaceholder sort of a second layer?
by the way the image is populated from the Database so i had it on the HtmlPlaceHolder compared to using the native Image and ImageBrush controls for Silverlight.
Thank you and waiting for your response... :)
i have the following code below:
<Grid>
<ScrollViewer Margin="10" BorderThickness="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<StackPanel Orientation="Horizontal">
<StackPanel x:Name="rootElement" >
<TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Top" Text="Question" TextWrapping="Wrap" Margin="7.5,8,8.5,0" TextAlignment="Left" x:Name="Question" FontWeight="Bold" FontFamily="Portable User Interface" Height="54"/>
<telerik:RadHtmlPlaceholder HorizontalAlignment="Left" x:Name="RadHtmlPlaceholder2"
MouseLeftButtonDown="RadHtmlPlaceholder2_MouseLeftButtonDown" MouseLeftButtonUp="RadHtmlPlaceholder2_MouseLeftButtonUp">
<Line x:Name="lineStroke" Stroke="Red" StrokeThickness="5"></Line>
</telerik:RadHtmlPlaceholder>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
Codebehind:
private
void RadHtmlPlaceholder2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
startPointx = e.GetPosition(
this.RadHtmlPlaceholder2).X.ToString();
startPointy = e.GetPosition(
this.RadHtmlPlaceholder2).Y.ToString();
}
private void RadHtmlPlaceholder2_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
endPointx = e.GetPosition(
this.RadHtmlPlaceholder2).X.ToString();
endPointy = e.GetPosition(
this.RadHtmlPlaceholder2).Y.ToString();
if (startPointx != null)
{
lineStroke.X1 =
Convert.ToDouble(startPointx);
lineStroke.X2 =
Convert.ToDouble(endPointx);
lineStroke.Y1 =
Convert.ToDouble(startPointy);
lineStroke.Y2 =
Convert.ToDouble(endPointy);
startPointx =
string.Empty;
startPointy =
string.Empty;
}
}