I have a similar need as described in this post:
https://ko.infragistics.com/community/forums/t/49045.aspx
However, I need to display multiple series of EventSpans/Points where each series is stacked. Using the code from the above post and modifying it to use a negative EventSpan control template margin (as I want series to be stacked above the Axis), the stacked series are clipped from the control (I added a grid splitter control to try and dynamically expand the control in a grid, but that does not allow the control to resize and draw all the stacked series either). I need to do this for an arbitrary number of series, and I know I have to calculate margins for the control templates based on the (assuming this capability has not been added as an option since the post above), but how can I expand the area the EventSpans can be drawn in?
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" />
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.Resources>
<Style x:Key="ZoombarStyle" TargetType="{x:Type ig:XamZoombar}">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
<Style x:Key="EventSpan1Style" TargetType="ig:EventSpan">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ig:EventSpan">
<Grid Margin="0,2,0,2">
<Rectangle Margin="0,0,0,0" RadiusX="5" RadiusY="5" Fill="{ TemplateBinding Fill}" Stroke="{ TemplateBinding Stroke}" StrokeThickness="1" Height="10" VerticalAlignment="Top" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style x:Key="EventSpan2Style" TargetType="ig:EventSpan">
<Rectangle Margin="0,-8,0,0" RadiusX="5" RadiusY="5" Fill="{ TemplateBinding Fill}" Stroke="{ TemplateBinding Stroke}" StrokeThickness="1" Height="10" VerticalAlignment="Top" />
</Grid.Resources>
<ig:XamTimeline x:Name="xamTimeline" ZoombarStyle="{StaticResource ZoombarStyle}">
<ig:XamTimeline.Series>
<ig:DateTimeSeries Title="Series 1"
EventSpanStyle="{StaticResource EventSpan1Style}">
<ig:DateTimeSeries.Entries>
<ig:DateTimeEntry Time="07:00 01/01/2000" Duration="3:00" />
<ig:DateTimeEntry Time="12:00 01/01/2000" Duration="2:00" />
</ig:DateTimeSeries.Entries>
</ig:DateTimeSeries>
<ig:DateTimeSeries Title="Series 2" Fill="Red"
EventSpanStyle="{StaticResource EventSpan2Style}">
<ig:DateTimeEntry Time="09:00 01/01/2000" Duration="2:00" />
<ig:DateTimeEntry Time="14:00 01/01/2000" Duration="1:00" />
</ig:XamTimeline.Series>
</ig:XamTimeline>
Hello Gary,
Thank you for your input on this matter.
I am rather surprised that the http://schemas.infragistics.com/xaml namespace is reproducing this issue on your end, although it does essentially "wrap" the Infragistics.Controls.Timelines namespace mentioned in a previous update, and so perhaps that is why the error is occurring there as well.
It does not entirely surprise me that the error does not happen when the XamTimeline is removed, since at that point, it doesn't appear that you are using the Infragistics namespace, and so Visual Studio will not try to access it when compiling. This still doesn't really explain why the issue is actually happening with the XamTimeline, though. Does this issue happen for you when using other Infragistics controls in your project, or just the XamTimeline, specifically?
It is also possible that this could be a defect in the 15.1 version, specifically. Would it be possible for you to please provide the specific version of Infragistics for WPF 2015.1 that you are using? This number would look like 15.1.20151.XXXX.
I can't help but feel like this could have to do with the "Mont.Utilities.Utilities.UI.Infragistics" namespace that you had mentioned in a previous update, as I feel like Visual Studio might be searching for a "Controls" child namespace to that one, and it may think that you are trying to reference Mont.Utilities.Utilities.UI.Infragistics.Controls.Timelines in this case. I am unsure why exactly Visual Studio would try to do this, and in creating a sample project with a namespace ending with "Infragistics," I was unable to reproduce the behavior you are seeing.
Do you perhaps have an isolated sample project that I could run on my end that reproduces this behavior? If so, I would gladly take a look and try to assist you further.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Thanks for the suggestions, I did check the .NET Framework versions and we are using .NET 4 (no "Client Profile options), so that is not the issue. I did move the UserControl to the Mont.Utilities.UI.StackedTimeline namespace but still have the same error come up. In this configuration this XAML generates the error:
From the error message that you are seeing and the screenshot you have provided, I can't really say why exactly this error is occurring in your project. The XamTimeline does exist in the Infragistics.Controls.Timelines namespace, and it appears that you have referenced the correct DLL as well.
The odd thing in this case is that for some reason, your Visual Studio instance appears to be looking in your Mont.Utilities.Utilities.UI.Infragistics namespace for a "Controls" type or namespace. This leads me to think that perhaps the "Infragistics" part of your clr-namespace definition for your "igTimeline" xmlns definition is being confused with a local Mont.Utilities.Utilities.UI.Infragistics namespace? You can test this by creating a XAML page that is outside of that Mont.Utilities.Utilities.UI.Infragistics namespace, and try using the XamTimeline in the same way there.
I also dug up an interesting issue with the "Client Profile" .NET Framework versions. By any chance, is your project targeting any of the .NET XX Client Profile versions in this case? If it is, if you change to the .NET XX (non client profile) version, is this error resolved?
Thanks Andrew, this suggestion got me a little further and I have a user control example in isolation. When I try to incorporate this into my main solution (via adding it to an existing utility project), I am getting a different error of namespace "Controls" does not exists in the name space. It is a little weird because I have reduced the original file down to its bear essentials of just including the XamTimeline and minimal namespaces trying to troubleshoot this issue and I still get this same error even though the timeline draws in the designer window (see attached screen shot). I do not understand what the 'Controls" namespace error is referring to, any thoughts on what might be causing this?
EDIT: As an update, it seems I can eliminate the above issue by including the UserControl I created as a separate isolated project, obviously far from ideal, so something within the full project is conflicting with including this control.
It sounds like you are likely using our XamSlider control along with the XamTimeline. Both of these controls have references to a "TickMarksPanel," but these two panels work differently. So, by using the xmlns:ig="http://schemas.infragistics.com/xaml" namespace, which encapsulates both the Infragistics.Controls.Editors and Infragistics.Controls.Timelines namespaces, Visual Studio cannot determine which one you actually mean to use.
To work around this, I would recommend defining an explicit namespace definition that points at the XamTimeline assembly, specifically. If you were using version 16.2, this explicit namespace definition could look like the following:
xmlns:igTimeline="clr-namespace:Infragistics.Controls.Timelines;assembly=InfragisticsWPF4.Controls.Timelines.XamTimeline.v16.2"
This will allow you to define the TickMarksPanel like so, which should resolve this error you are seeing:
<igTimeline:TickMarksPanel.... />