Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
523
Setting EventTitleStyle in vb.net
posted

 I am trying to set the EventTitleStyle of multiple datetime series that I am adding thru vb.net.  I have the styles setup in the xaml but can't find a way to set the style in code.  If I setup the series in the xaml it works fine, just need to find out how to set it from code.

Thanks

Rob

Parents
  • 30692
    Verified Answer
    Offline posted

    Rob,

    Could you explain how you are trying to set the styles programmatically? Here's an example of one way to do it:

    Xaml:

    <UserControl x:Class="SilverlightApplication25.MainPage"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

        mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"

        xmlns:igtl="clr-namespace:Infragistics.Silverlight.Timeline;assembly=Infragistics.Silverlight.DataVisualization.Timeline.v9.2">

        <UserControl.Resources>

            <Style x:Key="TitleStyle" TargetType="igtl:EventTitle">

                <Style.Setters>

                    <Setter Property="Foreground" Value="Red" />

                </Style.Setters>

            </Style>

        </UserControl.Resources>

       

        <Grid x:Name="LayoutRoot">     

                <igtl:XamWebTimeline x:Name="timeLine">

                <igtl:DateTimeSeries>

                    <igtl:DateTimeSeries.Entries>

                        <igtl:DateTimeEntry Time="01/01/1996" Title="Date Time Entry 1"

                                                Details="Details Time Entry 1"/>

                        <igtl:DateTimeEntry Time="01/01/2000" Title="Date Time Entry 2"

                                                Details="Details Time Entry 2"/>

                        <igtl:DateTimeEntry Time="01/01/2004" Title="Date Time Entry 3"

                                                Details="Details Time Entry 3"/>

                        <igtl:DateTimeEntry Time="01/01/2008" Title="Date Time Entry 3"

                                                Details="Details Time Entry 4"/>

                        <igtl:DateTimeEntry Time="01/01/2012" Title="Date Time Entry 3"

                                                Details="Details Time Entry 5"/>

                    </igtl:DateTimeSeries.Entries>

                </igtl:DateTimeSeries>

            </igtl:XamWebTimeline>

        </Grid>

    </UserControl>

     

    Code Behind:

        public partial class MainPage : UserControl

        {

            public MainPage()

            {

                InitializeComponent();

     

                timeLine.Series[0].EventTitleStyle = (Style)Resources["TitleStyle"];

            }

        }

    -Graham

Reply Children
No Data