This question is locked. New answers and comments are not allowed.
In the behind code can't obtain the "Content" of Shap which is a item of Diagram control .
This is a serious problem , indicating that the " not will object reference set to an instance of an object. " error.
XAML:
<telerik:RadDiagramShape Geometry="{telerik:CommonShape ShapeType=RoundedRectangleShape}"
x:Name="rd_SiPing" Width="100" Height="35"
Content="Harvard University"
Tag="A"
FontSize="14"
Position="193,120"
Background="LightGray"
MouseLeftButtonDown="rd_SiPing_MouseLeftButtonDown" >
</telerik:RadDiagramShape>
<telerik:RadDiagramShape Geometry="{telerik:CommonShape ShapeType=RoundedRectangleShape}"
x:Name="rd_SiPingValue" Width="100" Height="25"
Content="1716.0kW"
Tag="A"
FontSize="12"
Position="193,160"
Background="LightGray"
/>
Code behind:
private void rd_SiPing_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
string str = rd_SiPingValue.Content.ToString();
string strtwo = rd_Region.Content.ToString();
string strthree = rd_SiPing.Tag.ToString();
Question: Three lines of code as above are all prompt error: "not will object reference set to an instance of an object."
Why???
}
This is a serious problem , indicating that the " not will object reference set to an instance of an object. " error.
XAML:
<telerik:RadDiagramShape Geometry="{telerik:CommonShape ShapeType=RoundedRectangleShape}"
x:Name="rd_SiPing" Width="100" Height="35"
Content="Harvard University"
Tag="A"
FontSize="14"
Position="193,120"
Background="LightGray"
MouseLeftButtonDown="rd_SiPing_MouseLeftButtonDown" >
</telerik:RadDiagramShape>
<telerik:RadDiagramShape Geometry="{telerik:CommonShape ShapeType=RoundedRectangleShape}"
x:Name="rd_SiPingValue" Width="100" Height="25"
Content="1716.0kW"
Tag="A"
FontSize="12"
Position="193,160"
Background="LightGray"
/>
Code behind:
private void rd_SiPing_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
string str = rd_SiPingValue.Content.ToString();
string strtwo = rd_Region.Content.ToString();
string strthree = rd_SiPing.Tag.ToString();
Question: Three lines of code as above are all prompt error: "not will object reference set to an instance of an object."
Why???
}