Click here to Skip to main content
15,887,175 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Some good WPF books? Pin
carlecomm9-Mar-10 18:13
carlecomm9-Mar-10 18:13 
GeneralRe: Some good WPF books? Pin
Dan Mos10-Mar-10 5:19
Dan Mos10-Mar-10 5:19 
AnswerRe: Some good WPF books? Pin
Richard MacCutchan9-Mar-10 21:40
mveRichard MacCutchan9-Mar-10 21:40 
QuestionWPF mapping with Dependency properties Pin
Juan Pablo G.C.9-Mar-10 1:05
Juan Pablo G.C.9-Mar-10 1:05 
AnswerRe: WPF mapping with Dependency properties Pin
Pete O'Hanlon9-Mar-10 1:46
mvePete O'Hanlon9-Mar-10 1:46 
QuestionFormat datetime value in XMAL Pin
Garrisoft9-Mar-10 1:03
Garrisoft9-Mar-10 1:03 
AnswerRe: Format datetime value in XMAL Pin
Abhinav S14-Mar-10 21:11
Abhinav S14-Mar-10 21:11 
QuestionHow to avoid 'System.StackOverflowException' when saving a canvas in a xaml Pin
Bhagya Thambugala8-Mar-10 6:22
Bhagya Thambugala8-Mar-10 6:22 
I am getting the following exception when trying to save a canvas in a wpf xaml file.
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

The following is what I did:

I am having a canvas in a wpf window which contains a chart and some labels.

<Canvas x:Name="c1">
<chartingToolkit:Chart x:Name="Time_Distance_Graph" Width="1292" Height="800" Canvas.Left="2" Canvas.Top="50" BorderThickness="0" xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit">

<chartingToolkit:Chart.Resources>
<Style x:Key="LineDataPointStyle" TargetType="charting:LineDataPoint" xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit">
<Setter Property="Visibility" Value="Hidden"/>
</Style>
</chartingToolkit:Chart.Resources>

<chartingToolkit:Chart.Axes>
<chartingToolkit:LinearAxis Orientation="X" Maximum="48" Interval="1" Title="Time" Margin="0,20,0,0" Visibility="Hidden" Minimum="0" ShowGridLines="False" />
<chartingToolkit:LinearAxis Orientation="Y" Title="Distance" Maximum="35" Minimum="0" Interval="0.5" Visibility="Hidden" ShowGridLines="False" />
</chartingToolkit:Chart.Axes>

<chartingToolkit:Chart.LegendStyle>
<Style TargetType="Control">
<Setter Property="Width" Value="0"/>
<Setter Property="Height" Value="0"/>
</Style>
</chartingToolkit:Chart.LegendStyle>

<chartingToolkit:Chart.ChartAreaStyle>
<Style TargetType="Panel">
<Setter Property="Width" Value="1259"/>
<Setter Property="Height" Value="743"/>
</Style>
</chartingToolkit:Chart.ChartAreaStyle>
</chartingToolkit:Chart>

<Label Canvas.Left="1095" Canvas.Top="37.5" Height="25" Width="37.5" Content="Date:" Name="lblDate"/>
<Label ………………………/>
<Label ………………………/>

<Label ………………………/>

</Canvas>

And also from the code behind I am adding more labels and lines dynamically to the canvas according to the requirement.

When the save button is clicked.
The following code is set to be executed.

FileStream saveFile = new FileStream(filepath, FileMode.Create);
XamlWriter.Save(c1, saveFile);

How can I get rid of the above exception?

Expecting a soon reply.
Thanks in Advance.
QuestionDatabinding to a single element from RIA [modified] Pin
Pankaj Nikam8-Mar-10 5:14
professionalPankaj Nikam8-Mar-10 5:14 
QuestionListView issues Pin
#realJSOP6-Mar-10 3:37
mve#realJSOP6-Mar-10 3:37 
AnswerRe: ListView issues Pin
Eslam Afifi6-Mar-10 8:19
Eslam Afifi6-Mar-10 8:19 
GeneralRe: ListView issues Pin
#realJSOP6-Mar-10 9:35
mve#realJSOP6-Mar-10 9:35 
GeneralRe: ListView issues Pin
Eslam Afifi6-Mar-10 10:51
Eslam Afifi6-Mar-10 10:51 
GeneralRe: ListView issues Pin
Pete O'Hanlon6-Mar-10 11:14
mvePete O'Hanlon6-Mar-10 11:14 
GeneralRe: ListView issues Pin
Eslam Afifi6-Mar-10 12:27
Eslam Afifi6-Mar-10 12:27 
GeneralRe: ListView issues Pin
Pete O'Hanlon6-Mar-10 12:34
mvePete O'Hanlon6-Mar-10 12:34 
GeneralRe: ListView issues Pin
Eslam Afifi6-Mar-10 13:02
Eslam Afifi6-Mar-10 13:02 
GeneralRe: ListView issues Pin
Pete O'Hanlon6-Mar-10 9:41
mvePete O'Hanlon6-Mar-10 9:41 
AnswerRe: ListView issues Pin
Pete O'Hanlon6-Mar-10 10:22
mvePete O'Hanlon6-Mar-10 10:22 
QuestionDisplay System.Windows.Forms.Form as child of Wpf Window Pin
abhinish6-Mar-10 1:01
abhinish6-Mar-10 1:01 
AnswerRe: Display System.Windows.Forms.Form as child of Wpf Window Pin
#realJSOP6-Mar-10 2:17
mve#realJSOP6-Mar-10 2:17 
GeneralRe: Display System.Windows.Forms.Form as child of Wpf Window Pin
abhinish6-Mar-10 5:00
abhinish6-Mar-10 5:00 
GeneralRe: Display System.Windows.Forms.Form as child of Wpf Window Pin
#realJSOP6-Mar-10 5:29
mve#realJSOP6-Mar-10 5:29 
GeneralRe: Display System.Windows.Forms.Form as child of Wpf Window Pin
Valentin Billotte31-May-10 4:51
Valentin Billotte31-May-10 4:51 
QuestionBackgroundWorker and comboBox.Items.Add(f) Pin
HahnTech5-Mar-10 15:35
HahnTech5-Mar-10 15:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.