Hi,
I am wanting to know if its possible to retrieve the actual height of the timeslotpresenter, I can do it in code behind using the infragistics utilities but am trying to do it in xaml using a multibinding, however I can't seem to figure out what to reference as ancestor. This is what I tried to do.
<MultiBinding Converter="{x:Static valueConverters:SizeConverter.Instance}">
<Binding Path="DateFrom" />
<Binding Path="DateTo" />
<Binding Path="TimeslotInterval" ElementName="DayView" />
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type ig:XamDayView:TimeslotPresenter}}"/>
</MultiBinding>
Any help would be appreciated.
kind regards,
Anne
Hi Anne,
From within what control are you using this MultiBinding? Is it inside a TimeslotPresenter or some other control. If it's inside a Style setter for the Template of a TimeslotPresenter then you can just use {RelativeSource TemplatedParent} as the binding.
I need to know more about how you are using this MultiBinding and where it is located.
Hi Rob,
Thank you for your speedy reply, I have created a 'custom control' if you will, and it shows the status of items, e.g. from 10:00 - 12:00 shows in green, I want to make these 'timeslots' the same height per interval as the diary timeslots so that it is not confusing for the user as they have the diary on the same screen. Here is the full code:
<ItemsControl ItemsSource="{Binding Data}" Width="50" >
<ItemsControl.Template>
<ControlTemplate>
<ScrollViewer Padding="{TemplateBinding Padding}" Width="50" x:Name="Scroller" CanContentScroll="True" >
<ItemsPresenter />
</ScrollViewer>
/ControlTemplate>
</ItemsControl.Template>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" ></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Rectangle Fill="{Binding Brush}" Width="84" >
<Rectangle.Height>
<Binding Path="Height" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type igPrim:TimeslotPresenter}}"/>
</Rectangle.Height>
</Rectangle>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
So if you imagine on the left of screen I have xamdayview functioning as normal and on the right is this control, the two don't work together at all, or I am wanting to do is get the height of the timeslotpresenter used in the dayview to pass into my converter for a custom calculation I have and then to colour my custom control as needed. So I am just trying to get a bind to the timeslotpresenter. As I said in my previous message I can do this via code behind but was just wondering if its not possible to do in a binding.
I have looked at this example
http://es.infragistics.com/community/forums/p/86469/431308.aspx