I have custom fields in my Appointment Dialog. I want to change one of the TextBoxes to a ComboBox.
Here is the section I want to modify that is currently in my Telerik.Windows.Controls.ScheduleView.xaml
I want to replace the second textbox with the following:
I want to bind the ItemsSource to an ObservableCollection available in my View Model page. I then want to bind the selected item to Occurrence.Appointment.RescheduleReason much like the current textbox's text is bound to.
I am having issues accessing the ObservableCollection CancelReasons though. It is set up in my ViewModel as:
How can I accomplish this?
Here is the section I want to modify that is currently in my Telerik.Windows.Controls.ScheduleView.xaml
<
TextBlock
Grid.Row
=
"7"
Grid.Column
=
"0"
Margin
=
"6"
VerticalAlignment
=
"Center"
telerik:LocalizationManager.ResourceKey
=
"Reason for reschedule"
/>
<
TextBox
Grid.Row
=
"7"
Grid.Column
=
"1"
Grid.ColumnSpan
=
"2"
Margin
=
"3"
IsReadOnly
=
"{Binding IsReadOnly}"
Text
=
"{Binding Occurrence.Appointment.RescheduleReason, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"
telerik:StyleManager.Theme
=
"{StaticResource Theme}"
/>
I want to replace the second textbox with the following:
<ComboBox Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="2" Margin="3" ItemsSource="{Binding }"
I want to bind the ItemsSource to an ObservableCollection available in my View Model page. I then want to bind the selected item to Occurrence.Appointment.RescheduleReason much like the current textbox's text is bound to.
I am having issues accessing the ObservableCollection CancelReasons though. It is set up in my ViewModel as:
private ObservableCollection<
OptionSet
> cancelReasons;
public ObservableCollection<
OptionSet
> CancelReasons
{
get
{
return this.cancelReasons;
}
private set
{
this.cancelReasons = value;
this.OnPropertyChanged("CancelReasons");
}
}
How can I accomplish this?