Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic TimetableSettings Bindings (Read 4484 times)
Nika
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Oct 11th, 2018
TimetableSettings Bindings
Oct 11th, 2018 at 9:42am
Print Post  
Hello Meppy,

I'd like to bind the Dates Property to a DateCollection, which is in another class.

This is my XAML Code so far:
<planner:Calendar Theme="{Binding Path=Theme}">
   <planner:Calendar.TimetableSettings>
      <planner:TimetableSettings Dates="{Binding
          Path=DateCollection}"> ...

Now you see that I already did that with the Theme Property of the Calendar and it works perfectly. But it won't work with Dates, although I did the Binding exactly like the Theme Binding.
I tried to debug it and it doesn't even go inside get{...}.

I saw some answers how to deal with that problem in the code-behind, but I have to work strictly with the MVVM pattern.

Thanks in advance  Smiley
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3183
Joined: Oct 19th, 2005
Re: TimetableSettings Bindings
Reply #1 - Oct 11th, 2018 at 4:44pm
Print Post  
Hi,

Binding worked in my test project -
https://mindfusion.eu/_samples/DatesBinding.zip

Check if your DateCollection is a public property and of same MindFusion.Scheduling.Wpf.DateCollection type as TimetableSettings' one.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Nika
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Oct 11th, 2018
Re: TimetableSettings Bindings
Reply #2 - Oct 15th, 2018 at 7:35am
Print Post  
Thanks for your response, but sadly it didn't help. As I already said, I did everyting just like with the Theme and there everyting worked perfectly.

I tried to debug the DataBinding with the System.Diagnostics class and this is what I get:

System.Windows.Data Warning: 56 : Created BindingExpression (hash=53954942) for Binding (hash=11903911)
System.Windows.Data Warning: 58 :   Path: 'DateCollection'
System.Windows.Data Warning: 60 : BindingExpression (hash=53954942): Default mode resolved to OneWay
System.Windows.Data Warning: 61 : BindingExpression (hash=53954942): Default update trigger resolved to PropertyChanged
System.Windows.Data Warning: 62 : BindingExpression (hash=53954942): Attach to MindFusion.Scheduling.Wpf.TimetableSettings.Dates (hash=52136226)
System.Windows.Data Warning: 67 : BindingExpression (hash=53954942): Resolving source
System.Windows.Data Warning: 70 : BindingExpression (hash=53954942): Found data context element: TimetableSettings (hash=52136226) (OK)
System.Windows.Data Warning: 71 : BindingExpression (hash=53954942): DataContext is null
System.Windows.Data Warning: 65 : BindingExpression (hash=53954942): Resolve source deferred
System.Windows.Data Warning: 67 : BindingExpression (hash=53954942): Resolving source
System.Windows.Data Warning: 70 : BindingExpression (hash=53954942): Found data context element: TimetableSettings (hash=52136226) (OK)
System.Windows.Data Warning: 71 : BindingExpression (hash=53954942): DataContext is null

With the working Binding it looks like this:

System.Windows.Data Warning: 56 : Created BindingExpression (hash=3957675) for Binding (hash=29135240)
System.Windows.Data Warning: 58 :   Path: 'Theme'
System.Windows.Data Warning: 60 : BindingExpression (hash=3957675): Default mode resolved to OneWay
System.Windows.Data Warning: 61 : BindingExpression (hash=3957675): Default update trigger resolved to PropertyChanged
System.Windows.Data Warning: 62 : BindingExpression (hash=3957675): Attach to MindFusion.Scheduling.Wpf.Calendar.Theme (hash=12674872)
System.Windows.Data Warning: 67 : BindingExpression (hash=3957675): Resolving source
System.Windows.Data Warning: 70 : BindingExpression (hash=3957675): Found data context element: Calendar (hash=12674872) (OK)
System.Windows.Data Warning: 71 : BindingExpression (hash=3957675): DataContext is null
System.Windows.Data Warning: 65 : BindingExpression (hash=3957675): Resolve source deferred
System.Windows.Data Warning: 67 : BindingExpression (hash=3957675): Resolving source
System.Windows.Data Warning: 70 : BindingExpression (hash=3957675): Found data context element: Calendar (hash=12674872) (OK)
System.Windows.Data Warning: 78 : BindingExpression (hash=3957675): Activate with root item MainWindowVM (hash=31874772)
System.Windows.Data Warning: 108 : BindingExpression (hash=3957675):   At level 0 - for MainWindowVM.Theme found accessor RuntimePropertyInfo(Theme)
System.Windows.Data Warning: 104 : BindingExpression (hash=3957675): Replace item at level 0 with MainWindowVM (hash=31874772), using accessor RuntimePropertyInfo(Theme)
System.Windows.Data Warning: 101 : BindingExpression (hash=3957675): GetValue at level 0 from MainWindowVM (hash=31874772) using RuntimePropertyInfo(Theme): 'Windows2003'
System.Windows.Data Warning: 80 : BindingExpression (hash=3957675): TransferValue - got raw value 'Windows2003'
System.Windows.Data Warning: 89 : BindingExpression (hash=3957675): TransferValue - using final value 'Windows2003'

I can't find any solution online  Sad
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3183
Joined: Oct 19th, 2005
Re: TimetableSettings Bindings
Reply #3 - Oct 15th, 2018 at 8:15am
Print Post  
Please attach a test project reproducing that - e.g. modify mine above to show your setup, and our developer will investigate.
  
Back to top
 
IP Logged
 
Nika
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Oct 11th, 2018
Re: TimetableSettings Bindings
Reply #4 - Oct 15th, 2018 at 9:35am
Print Post  
Here's the small version of the solution.
Thanks for your help. Smiley
  

Stundenverwaltung.zip ( 11 KB | 262 Downloads )
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3183
Joined: Oct 19th, 2005
Re: TimetableSettings Bindings
Reply #5 - Oct 16th, 2018 at 8:12am
Print Post  
Below is wham I'm getting, is it the expected result? If yours is different, maybe you have older version of the control than one I'm testing with. Try replacing your assemblies with the one from my test project above.



Regards,
Slavcho
  
Back to top
 
IP Logged
 
Nika
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Oct 11th, 2018
Re: TimetableSettings Bindings
Reply #6 - Oct 16th, 2018 at 8:44am
Print Post  
It works now with your assemblies. Thank you very much!  Smiley Grin
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint