in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Is it possible to display a picture in the scheduler for an appointment ?

Last post 07-17-2008 1:57 PM by StudentOne. 15 replies.
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts: Previous Next
  • 04-23-2008 12:35 PM

    Is it possible to display a picture in the scheduler for an appointment ?

    Hi,

    I would like to know if it is possible to had an icon that represent different kind of appointment in the scheduler, like this screenshot (i have add the icon with photoshop)

    :

    Thanks

    Thomas

  • 04-23-2008 1:04 PM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    > I would like to know if it is possible to had an icon that represent different kind of
    > appointment in the scheduler, like this screenshot (i have add the icon with photoshop)
    You should change IntervalAppointmentTemplate. Search source xaml for default
    implementation, edit template and set C1Scheduler.IntervalAppointmentTemplate property to
    your template.
  • 04-24-2008 4:21 AM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    Thank you for your answer.

    I have tried to use the IntervalAppointmentTemplate.xaml that you give on your sample. But i don't find any sample that show how to use it. So I just tried to implement it like a sheduler theme, but it doesn't work.

    I have declared the resource dictionnary like that :

    <ResourceDictionary>

    <ResourceDictionary x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type c1sched:C1Scheduler},

    ResourceId=IntervalAppointmentTemplate}" Source="Styles/IntervalAppointmentTemplate.xaml" />

    <ResourceDictionary.MergedDictionaries>

    <ResourceDictionary Source="Styles/Style_default.xaml"/>

    </ResourceDictionary.MergedDictionaries>

    </ResourceDictionary>

    And use it like that :

    <my:C1Scheduler Name="scheduler1" Margin="0,28,0,0"

    IntervalAppointmentTemplate="{DynamicResource {ComponentResourceKey TypeInTargetAssembly=c1sched:C1Scheduler, ResourceId=IntervalAppointmentTemplate}}"/>

     

    But i have the following error :

    Erreur 19 La propriété 'IntervalAppointmentTemplate' ne prend pas en charge les valeurs de type 'System.Windows.ResourceDictionary'. C:\dev\NOVEAGEN_V1\Controles_Utilisateurs\Calendrier_soins\UC_Calendrier_soins.xaml 60 25 Calendrier_soins

    Thanks

    Thomas

  • 04-24-2008 5:41 AM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    No, IntervalAppointmentTemplate is DataTemplate and you should assign it directly to corresponding property of the control. Don't use ComponentResourceKey.

    In you IntervalAppointmentTemplate.xaml file define DataTemplate with some key:   

    <DataTemplate x:Key="myIntervalAppointmentTemplate">

      <DataTemplate.Resources>

    ...

    Then change your xaml in the next way: 

    <ResourceDictionary>
       <ResourceDictionary.MergedDictionaries>
          <ResourceDictionary Source="Styles/Style_default.xaml"/>
          <ResourceDictionary Source="Styles/IntervalAppointmentTemplate.xaml"/>
       <ResourceDictionary.MergedDictionaries/>
    </ResourceDictionary>

    And use it like that:

    <my:C1Scheduler Name="scheduler1" Margin="0,28,0,0" IntervalAppointmentTemplate ="{DynamicResource myIntervalAppointmentTemplate}"/>

  • 04-24-2008 10:23 AM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    Thanks Its works find. In order to put biggest image, Is it possible to specify the different Height of the appointment that appear in the scheduler, in Monthly, weekly and Daily view  ?

    Thanks

    Thomas

  • 04-24-2008 11:55 AM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    > Thanks Its works find. In order to put biggest image, Is it possible to specify the different Height of the appointment that appear in the scheduler, in Monthly, weekly and Daily view  ?
    Unfortunately it isn't possible for month view in the current version. Appointment height is set automatically.
     
    You may try one of the next:
     
    - scale image. If you set image height and width in IntervalAppointmentTemplate, image will be scaled to this size automatically;
    - set negative margins for image or for it's container in order to show image out of appointment
        borders as it is shown on your screenshot.
     
    in a Day View appointment height is set according to appointment duration. So, if you change DayView style and set time slot height for bigger value, you may get desired appointment height. To do so, you can copy C1Scheduler_TimeRuler_Template from source xaml into your theme ResourceDictionary and set desired height for ItemTemplate in IntervalMarkersList:
     
     <DataTemplate x:Key="C1Scheduler_TimeRuler_Template">
      <Grid Name="OneHourGrid">
       <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition MinWidth="20" SharedSizeGroup="Minutes" />
       </Grid.ColumnDefinitions>
       <ItemsControl Grid.Column="1" x:Name="IntervalMarkersList" ItemsSource="{Binding Items}">
        <ItemsControl.ItemTemplate>
         <DataTemplate>
          <!-- ***** set height in the next line -->
          <Border BorderThickness="0,1px,0,0" Margin="0,0,4,0" SnapsToDevicePixels="True" Height="30"
            BorderBrush="{DynamicResource C1Scheduler_ControlAreaLines_Brush}" />
         </DataTemplate>
        </ItemsControl.ItemTemplate>
    ...
  • 04-24-2008 1:12 PM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    Hi,

    If i don't specify height and width for my image, the image is scale and appear completly but it is to small.

    When i specify height and width, the picture doesn't fully appear.

    I have tried to add negative margin, but it doesn't seem to be better.

    I have create my image like that, maybe something is wrong ? :

    <DockPanel ClipToBounds="True" >

    <Border Name="leftInnerShowTimeBorder" DockPanel.Dock="Left"

    Width="{Binding Target.Left, ElementName=showTimeThickness}"

    Background="{Binding Appointment.BusyStatus.Brush.Brush}"

    BorderBrush="Black" BorderThickness="0,0,1px,0"

    CornerRadius="4,0,0,4" />

    <Image Source="../Images/Photo normal.png" Height="25" Width="25" Margin="-4,0,-4,0"/>

    <!-- If background is not specified, MouseDown event doesn't work for empty areas -->

    <c1sched:AppointmentWrapPanel Background="Transparent" Margin="2,0,2,0"

    DockLastChildToEnd="True" Orientation="Horizontal" x:Name="appointmentWrapPanel"

    IsReadOnly="{Binding Path=Interval.Scheduler.IsInPlaceEditingDisabled}">

    .......

     

    Thanks

    Thomas

     

  • 04-25-2008 5:04 AM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    It's working now, i forgot to put the property ClipToBounds of the contener to false.

    How can i dynamicly change the property image source of the image i have added, only for one appointment ?

     I have tried but i can't access to the property image of the datatemplate directly by code.

    Thanks

    Thomas

     

    Edit : I found a solution, but it isn't very good. I have used the Appointment.Tag fields to store path of image i would like to add to the appointment, and in the datatemplate of IntervalAppointmentTemplate, i use binding :

    <Image Source="{Binding Appointment.Tag}" Height="25" Width="25" Margin="0,-4,0,-4"/>

    But i am sure there is a better way.
  • 04-25-2008 8:11 AM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    > It's working now, i forgot to put the property ClipToBounds of the contener to false.
    I'm glad to hear of that.

    > How can i dynamicly change the property image source of the image i have added, only for
    > one appointment ?
    > I have tried but i can't access to the property image of the datatemplate directly by
    > code.
    If you can associate your image logically with appointment category, label, or maybe with
    some contacts or resources, you can handle this logic in xaml and change image source
    according to appointment properties. Look how it is made for "exceptionMark",
    "privateMark" and "recurrenceMark" in source xaml.
    Maybe it would be easier for you, if you implement your IntervalAppointmentTemplate with
    using of some code-behind.
  • 05-26-2008 9:03 AM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    The new version is available for downloading: http://prerelease.componentone.com/dotnet30/c1wpfschedule/2008-t2/C1WPFScheduler.3.0.20082.52.zip In this version you can set custom appointment height in a Month View mode (use AppointmentsCoverPane.CoverElementsHeight property in your custom templates).
  • 07-16-2008 7:02 PM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    What is the property to change font size for Event's subject?

     

  • 07-17-2008 5:59 AM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    > What is the property to change font size for Event's subject?

    There is no such property. Look at IntervalAppointmentTemplate in the source xaml. You can
    change whatever you want and set corresponding scheduler property to your template.
  • 07-17-2008 12:53 PM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    C1_IrinaP:
    > What is the property to change font size for Event's subject?

    There is no such property. Look at IntervalAppointmentTemplate in the source xaml. You can
    change whatever you want and set corresponding scheduler property to your template.
     

    Normal 0 false false false EN-CA X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;} Normal 0 false false false EN-CA X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

     

    I thought that IntervalAppointmentTemplate datatemplate should have a TextBox, Label or something similar to display event’s subject.
    And its property should be a property that I’m looking for.

  • 07-17-2008 12:54 PM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    C1_IrinaP:
    > What is the property to change font size for Event's subject?

    There is no such property. Look at IntervalAppointmentTemplate in the source xaml. You can
    change whatever you want and set corresponding scheduler property to your template.
     


    I thought that IntervalAppointmentTemplate datatemplate should have a TextBox, Label or something similar to display event’s subject.
    And its property should be a property that I’m looking for.

  • 07-17-2008 1:31 PM In reply to

    Re: Is it possible to display a picture in the scheduler for an appointment ?

    Sure, here is a fragment defining that: 

             <TextBlock FontWeight="Bold"
               Text="{Binding Appointment.Subject}" 
               Margin="2,0,2,0" TextWrapping="Wrap" />

    You can change textblock properties. In your case you should add FontSize attribute with the desired value.

    The full source xaml is available along with the control, you can use it with no limitations.

Page 1 of 2 (16 items) 1 2 Next >
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.