Hi,
I use the SfScheduler control in Timeline View.
I have set specialregions bound to an ObservableCollection (specialRegions), but when I update a region, no changes appear.
<syncfusion:TimelineViewSettings.SpecialTimeRegionTemplate>
<DataTemplate>
<Border Height="20" Background="{Binding Background}" VerticalAlignment="Bottom" CornerRadius="6" Opacity="1" BorderBrush="Black" BorderThickness="2">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" x:Name="Paiestack" MouseLeftButtonUp="Paie_MouseLeftButtonUp" >
<TextBlock Text="{Binding Text}" x:Name="infoPaie" Foreground="{Binding Foreground}" HorizontalAlignment="Center" />
<TextBlock Text="{Binding StartTime, StringFormat=\{0:dd/MM/yyyy\}}" x:Name="infoPaieDateTxt" Visibility="Collapsed"></TextBlock>
<TextBlock Text="{Binding ResourceIdCollection[0]}" x:Name="infoPaieIdTxt" Visibility="Collapsed"/>
</StackPanel>
</Border>
</DataTemplate>
</syncfusion:TimelineViewSettings.SpecialTimeRegionTemplate>
ObservableCollection<SpecialTimeRegion> specialRegions { get; set; }
public MainWindow()
{
InitializeComponent();
Schedule.TimelineViewSettings.StartHour = 7;
Schedule.TimelineViewSettings.EndHour = 18;
Schedule.DisplayDate =DateTime.Now;
specialRegions = new ObservableCollection<SpecialTimeRegion> { };
this.DataContext = this;
}
private void infoPaieEnregitrer_Click(object sender, RoutedEventArgs e)
{
var region = specialRegions.First(x =>
x.ResourceIdCollection.Any() &&
x.ResourceIdCollection[0] == infoPaieID &&
x.StartTime.ToShortDateString()==infoPaieDate.ToShortDateString()
);
region.Text = "OK !";
}
Could you help me please?
Thanks
Jim