0

I have a little problem.

My small WPF Project with a normal Calendar get a System.StackOverflowException Exception, when I try to use DisplayDateStart="{Binding DisplayDate.Date.Date.Now, ElementName=MeinCalendar, Mode=OneWay}" Binding.

I can start my Project without any errors, but when I click the Back and Next button a few times.Calendar throws the System.StackOverflowException Exception.

When I start the project without Binding this Exception is not more there.

How can I fix this bug?

<Window x:Class="WpfMVVMtest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
<Calendar  x:Name="calendar" DisplayDateStart="{Binding DisplayDate.Date.Now, ElementName=calendar, Mode=OneWay}" ></Calendar>

3
  • 2
    Real words and real sentences please. Try Mode=TwoWay and have a setter Commented Oct 30, 2012 at 15:56
  • I try :) i don't speek english soo good as you. Mode=TwoWay is not possible bc the DisplayDate.Date.Now ist protected.I can only read not save Commented Oct 31, 2012 at 7:37
  • 1
    I have the solution: <Calendar x:Name="calendar" DisplayDateStart="{Binding DisplayDate.Today, ElementName=calendar, Mode=OneWay}" ></Calendar> The problem was bc DisplayDate.Date.Now have time value which refresh evry 3 sec. Today value make this refresh not Commented Oct 31, 2012 at 13:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.