Hi,
I have a viewmodel define as the following and I dont know why but the value in the setter of the SelectedSlot property are null verry often:
public class ViewModel : Telerik.Windows.Controls.ScheduleView.Appointment
{
#region Constructors.
public ViewModel()
{
mGroupFilter = new Func<object, bool>(GroupFilterFunc);
}
#endregion
#region Public handlers.
internal delegate void SlotSelectionChangedHandler(object pSender, ScheduleViewSlotSelectionChangedArgs pArgs);
internal event SlotSelectionChangedHandler OnSlotSelectionChanged;
#endregion
#region Public methods.
public Func<object, bool> GroupFilter
{
get
{
return mGroupFilter;
}
private set
{
if (mGroupFilter != value)
{
mGroupFilter = value;
OnPropertyChanged(() => GroupFilter);
}
}
}
#endregion
#region Private methods.
private bool GroupFilterFunc(object pGroupName)
{
if (pGroupName is DateTime)
{
return ((DateTime)pGroupName).DayOfWeek != DayOfWeek.Saturday && ((DateTime)pGroupName).DayOfWeek != DayOfWeek.Sunday;
}
return true;
}
#endregion
#region Public properties.
public Slot SelectedSlot
{
set
{
if (mSelectedSlot != value)
{
mSelectedSlot = value;
this.OnPropertyChanged("SelectedSlot");
if (this.OnSlotSelectionChanged != null)
{
ScheduleViewSlotSelectionChangedArgs args = new ScheduleViewSlotSelectionChangedArgs();
args.NewSlot = mSelectedSlot;
this.OnSlotSelectionChanged(this, args);
}
}
}
get
{
return mSelectedSlot;
}
}
#endregion
#region Private members.
private Func<object, bool> mGroupFilter;
private Slot mSelectedSlot;
#endregion
}
Thank's
Alain
I have a viewmodel define as the following and I dont know why but the value in the setter of the SelectedSlot property are null verry often:
public class ViewModel : Telerik.Windows.Controls.ScheduleView.Appointment
{
#region Constructors.
public ViewModel()
{
mGroupFilter = new Func<object, bool>(GroupFilterFunc);
}
#endregion
#region Public handlers.
internal delegate void SlotSelectionChangedHandler(object pSender, ScheduleViewSlotSelectionChangedArgs pArgs);
internal event SlotSelectionChangedHandler OnSlotSelectionChanged;
#endregion
#region Public methods.
public Func<object, bool> GroupFilter
{
get
{
return mGroupFilter;
}
private set
{
if (mGroupFilter != value)
{
mGroupFilter = value;
OnPropertyChanged(() => GroupFilter);
}
}
}
#endregion
#region Private methods.
private bool GroupFilterFunc(object pGroupName)
{
if (pGroupName is DateTime)
{
return ((DateTime)pGroupName).DayOfWeek != DayOfWeek.Saturday && ((DateTime)pGroupName).DayOfWeek != DayOfWeek.Sunday;
}
return true;
}
#endregion
#region Public properties.
public Slot SelectedSlot
{
set
{
if (mSelectedSlot != value)
{
mSelectedSlot = value;
this.OnPropertyChanged("SelectedSlot");
if (this.OnSlotSelectionChanged != null)
{
ScheduleViewSlotSelectionChangedArgs args = new ScheduleViewSlotSelectionChangedArgs();
args.NewSlot = mSelectedSlot;
this.OnSlotSelectionChanged(this, args);
}
}
}
get
{
return mSelectedSlot;
}
}
#endregion
#region Private members.
private Func<object, bool> mGroupFilter;
private Slot mSelectedSlot;
#endregion
}
Thank's
Alain