This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I'm adding the Time Explorer to an existing project that we don't want to convert to Caliburn micro. Is there a way to use the Time Explorer control without Caliburn? My binding doesn't seem to be working correctly:
Then I do something like this in my constructor, just after InitializeComponent(); Random random = new Random(); ModelRangeStartTime = DateTime.Now - new TimeSpan(random.Next(90, 120), 0, 0, 0); ModelRangeEndTime = DateTime.Now - new TimeSpan(random.Next(30, 60), 0, 0, 0); ModelViewportStartTime = DateTime.Now - new TimeSpan(random.Next(365, 365 + 365), 0, 0, 0); ModelRangeEndTime = DateTime.Now; ChartData0 = RandomDataForTimeExplorer(ModelViewportStartTime, ModelRangeEndTime, (decimal)1.25); I've got public properties that look like this: public DateTime ModelRangeStartTime { get { return _startDate; } set { _startDate = value; NotifyPropertyChanged("ModelRangeStartTime"); } } I get a null reference error here: static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); <------- null reference error } Thanks for any help you can provide, I'm somewhat new to WPF and XAML and something of an idiot with XAML so far. Would love to see some example code on how to use Time Explorer without Caliburn. |
|
|
Hello Thanks for your interest in our TimeExplorer control. One of the main reasons this is not working is from a bug in the TimeExplorer. This bug has now been resolved and will be available in the next nightly build. The next nightly build will be available at around 1200 GMT which you'll be able to download from here: http://www.mindscapehq.com/products/wpfelements/nightly-builds I'm not sure if this will resolve the null reference exception though, but it does resolve an issue with binding. One thing I noticed in your xaml code is that you are binding the ViewportEndTime to the ModelViewportStartTime. Also, in the code, you are setting the ModelRangeEndTime twice: ModelRangeStartTime = DateTime.Now - new TimeSpan(random.Next(90, 120), 0, 0, 0); ModelRangeEndTime = DateTime.Now - new TimeSpan(random.Next(30, 60), 0, 0, 0); ModelViewportStartTime = DateTime.Now - new TimeSpan(random.Next(365, 365 + 365), 0, 0, 0); ModelRangeEndTime = DateTime.Now; Jason Fauchelle |
|