title: How to show custom labels and status on custom appointment window using WPF DevExpress and MVVM
body: <p>I'm using a Scheduler Control in which I want to create a custom appointment window. My Scheduler Control looks like this:</p>
  <pre><code>&lt;Grid&gt;
     &lt;Grid.ColumnDefinitions&gt;
        &lt;ColumnDefinition Width=&quot;*&quot;/&gt;
        &lt;ColumnDefinition Width=&quot;Auto&quot;/&gt;
     &lt;/Grid.ColumnDefinitions&gt;
     &lt;dxsch:SchedulerControl x:Name=&quot;scheduler&quot; ActiveViewType=&quot;WeekView&quot; FirstDayOfWeek=&quot;Monday&quot; Grid.Column=&quot;0&quot;&gt;
        &lt;dxsch:SchedulerControl.OptionsWindows&gt;
           &lt;dxsch:OptionsWindows AppointmentWindowType=&quot;{x:Type local:CrearTareaWindow}&quot;/&gt;
        &lt;/dxsch:SchedulerControl.OptionsWindows&gt;
        &lt;dxmvvm:Interaction.Behaviors&gt;
           &lt;dxmvvm:EventToCommand EventName=&quot;AppointmentAdded&quot; Command=&quot;{Binding SaveCommand}&quot; /&gt;
           &lt;dxmvvm:EventToCommand Command=&quot;{Binding DeleteCommand}&quot; EventName=&quot;AppointmentRemoved&quot;/&gt;
           &lt;dxmvvm:EventToCommand Command=&quot;{Binding EditCommand}&quot; EventName=&quot;AppointmentEdited&quot; /&gt;
        &lt;/dxmvvm:Interaction.Behaviors&gt;
        &lt;dxsch:SchedulerControl.DataSource&gt;
           &lt;dxsch:DataSource AppointmentsSource=&quot;{Binding Tareas}&quot; AppointmentLabelsSource=&quot;{Binding Labels}&quot; AppointmentStatusesSource=&quot;{Binding Status}&quot;&gt;
              &lt;dxsch:DataSource.AppointmentMappings&gt;
                 &lt;dxsch:AppointmentMappings
                    Subject=&quot;nombre&quot;
                    Description=&quot;descripcion&quot;
                    Start=&quot;fechaInicio&quot;
                    End=&quot;fechaFin&quot;&gt;
                    &lt;dxsch:CustomFieldMapping Mapping=&quot;custom&quot; Name=&quot;custom&quot; /&gt;
                 &lt;/dxsch:AppointmentMappings&gt;
              &lt;/dxsch:DataSource.AppointmentMappings&gt;
           &lt;/dxsch:DataSource&gt;
        &lt;/dxsch:SchedulerControl.DataSource&gt;
     &lt;/dxsch:SchedulerControl&gt;
     &lt;dxe:DateNavigator Name=&quot;dateNavigator&quot; Grid.Column=&quot;1&quot; ShowTodayButton=&quot;False&quot;&gt;
        &lt;dxe:DateNavigator.StyleSettings&gt;
           &lt;dxsch:SchedulerDateNavigatorStyleSettings Scheduler=&quot;{Binding ElementName=scheduler}&quot; /&gt;
        &lt;/dxe:DateNavigator.StyleSettings&gt;
     &lt;/dxe:DateNavigator&gt;
  &lt;/Grid&gt;
  </code></pre>
  <p>And my custom appointment window looks like this:</p>
  <pre><code>&lt;StackPanel Margin=&quot;10&quot;&gt;
     &lt;TextBlock FontWeight=&quot;Bold&quot; Text=&quot;Nombre:&quot;/&gt;
     &lt;TextBox Text=&quot;{Binding Subject, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}&quot;/&gt;
     &lt;TextBlock FontWeight=&quot;Bold&quot; Text=&quot;Descripción:&quot;/&gt;
     &lt;TextBox Text=&quot;{Binding Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}&quot; Height=&quot;100&quot;/&gt;
     &lt;TextBlock FontWeight=&quot;Bold&quot; Text=&quot;Fecha de Inicio:&quot;/&gt;
     &lt;DockPanel&gt;
        &lt;dxe:DateEdit
           x:Name=&quot;editorStartDate&quot;
           Width=&quot;150&quot;
           DockPanel.Dock=&quot;Left&quot;
           Style=&quot;{DynamicResource {dxscht:AppointmentWindowThemeKey ResourceKey=Editor_StartDate}}&quot; /&gt;
        &lt;dxe:TextEdit
           x:Name=&quot;editorStartTime&quot;
           Margin=&quot;4,0,0,0&quot;
           DockPanel.Dock=&quot;Left&quot;
           Style=&quot;{DynamicResource {dxscht:AppointmentWindowThemeKey ResourceKey=Editor_StartTime}}&quot; /&gt;
     &lt;/DockPanel&gt;
     &lt;TextBlock FontWeight=&quot;Bold&quot; Text=&quot;Fecha de fin:&quot;/&gt;
     &lt;DockPanel&gt;
        &lt;dxe:DateEdit
           x:Name=&quot;editorEndDate&quot;
           Width=&quot;150&quot;
           DockPanel.Dock=&quot;Left&quot;
           Style=&quot;{DynamicResource {dxscht:AppointmentWindowThemeKey ResourceKey=Editor_EndDate}}&quot; /&gt;
        &lt;dxe:TextEdit
           x:Name=&quot;editorEndTime&quot;
           Margin=&quot;4,0,0,0&quot;
           DockPanel.Dock=&quot;Left&quot;
           Style=&quot;{DynamicResource {dxscht:AppointmentWindowThemeKey ResourceKey=Editor_EndTime}}&quot; /&gt;
     &lt;/DockPanel&gt;
     &lt;TextBlock Text=&quot;Etiqueta:&quot; FontWeight=&quot;Bold&quot;/&gt;
     &lt;dxsch:AppointmentLabelEdit/&gt;
     &lt;TextBlock Text=&quot;Estatus:&quot; FontWeight=&quot;Bold&quot;/&gt;
     &lt;dxsch:AppointmentStatusEdit/&gt;
     &lt;TextBlock FontWeight=&quot;Bold&quot; Text=&quot;Custom:&quot;/&gt;
     &lt;TextBox Text=&quot;{Binding CustomFields.custom, Mode=TwoWay}&quot;/&gt;
     &lt;Grid Margin=&quot;0 10&quot;&gt;
        &lt;Grid.Resources&gt;
           &lt;Style TargetType=&quot;{x:Type Button}&quot;&gt;
              &lt;Setter Property=&quot;Margin&quot; Value=&quot;0 0 10 0&quot;/&gt;
           &lt;/Style&gt;
        &lt;/Grid.Resources&gt;
        &lt;Grid.ColumnDefinitions&gt;
           &lt;ColumnDefinition/&gt;
           &lt;ColumnDefinition/&gt;
           &lt;ColumnDefinition/&gt;
        &lt;/Grid.ColumnDefinitions&gt;
        &lt;Button Grid.Column=&quot;0&quot; Content=&quot;GUARDAR&quot; Command=&quot;{Binding SaveAndCloseAppointmentCommand}&quot;/&gt;
        &lt;Button Grid.Column=&quot;1&quot; 
           Content=&quot;BORRAR&quot; 
           CommandParameter=&quot;{Binding SelectedAppointments[0], ElementName=scheduler}&quot;
           Command=&quot;{Binding RemoveAppointmentCommand}&quot;/&gt;
        &lt;Button Grid.Column=&quot;2&quot; Content=&quot;CANCELAR&quot; Command=&quot;{Binding CancelEditingCommand}&quot;/&gt;
     &lt;/Grid&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  <p>In the custom appointment window I'm creating a <code>AppointmentLabelEdit</code> and <code>AppointmentStatusEdit</code> control to  show my custom labels and statuses, the problem is that they are not showing. I have binded the <code>AppointmentLabelsSource</code> and <code>AppointmentStatusSource</code> to the Scheduler Control DataSource as the documentation suggest, but I don't find a way to show my custom labels in the custom appointment window.
  The view model to which the SchedulerControl window is bindend looks like this:</p>
  <pre><code>public class ViewModel: ViewModelBase {
    public ObservableCollection &lt; Tarea &gt; Tareas {
      get;
      set;
    } = new ObservableCollection &lt; Tarea &gt; ();
    public ObservableCollection &lt; CustomLabel &gt; Labels {
      get;
      set;
    } = new ObservableCollection &lt; CustomLabel &gt; ();
    public ObservableCollection &lt; CustomStatus &gt; Status {
      get;
      set;
    } = new ObservableCollection &lt; CustomStatus &gt; ();
  
    public ViewModel() {
      Tareas.Add(new Tarea {
        nombre = &quot;Cita con el doctor&quot;,
        descripcion = &quot;Al PPL le duele la panza&quot;,
        fechaInicio = new DateTime(2020, 10, 1, 12, 0, 0),
        fechaFin = new DateTime(2020, 10, 1, 14, 0, 0),
        EtiquetaId = 2,
        EstatusId = 1
      });
      Labels.Add(new CustomLabel {
        Id = 1,
        Caption = &quot;DOCTOR&quot;,
        Color = Color.Blue
      });
      Labels.Add(new CustomLabel {
        Id = 2,
        Caption = &quot;GUARDIA&quot;,
        Color = Color.Green
      });
      Status.Add(new CustomStatus {
        Id = 1,
        Caption = &quot;PENDIENTE&quot;,
        Brush = Brushes.AliceBlue
      });
      Status.Add(new CustomStatus {
        Id = 2,
        Caption = &quot;TERMINADA&quot;,
        Brush = Brushes.OrangeRed
      });
    }
  }
  </code></pre>
  <p>What is the way to show the custom labels and statuses in my custom window?</p>