reference to default template in my project

4 posts, 0 answers
  1. Julien
    Julien avatar
    20 posts
    Member since:
    Oct 2013

    Posted 02 Dec 2014 Link to this post

    Hello, I want to reference the default template of the MilestoneContainer but I don't achieve this.
    the goal is to use the default template and override when a dataTrigger is firing
    I try to only define the data trigger
    <Style BasedOn="{StaticResource ResourceKey={x:Type telerik:MilestoneContainer}}" TargetType="{x:Type telerik:MilestoneContainer}">

                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Converter={StaticResource ObjectAndTypeToVisibilityConverter}, ConverterParameter={x:Type vm:GanttTaskModelePlanningFamille}}" Value="True">
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate>
                                            <Rectangle Width="3"
                                                       Height="24"
                                                       Fill="{TemplateBinding Background}" />
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
    It's no working, trigger have no action
    I try to reference the default template in my style definition (to force the trigger)
    <Setter Property="Template" Value="{StaticResource MilestoneContainerTemplate}" />
    But still not working, the resource is not know
    I also try to do reference at resource using the telerik dll, but the import failed (build failed)
    <ResourceDictionary Source="pack://application:,,,/Telerik.Windows.Controls.GanttView;component/Telerik.Windows.Controls.GanttView.xaml" /> 

    Have you any idea how I can solve my problem ?

    Thanks






  2. Masha
    Admin
    Masha avatar
    355 posts

    Posted 03 Dec 2014 Link to this post

    Hi Julian,

    I've created a sample project which demonstrates the wokring DataTriger without a parameter. Please check if this example works for you.

    I hope it helps.

    Regards,
    Masha
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Julien
    Julien avatar
    20 posts
    Member since:
    Oct 2013

    Posted 03 Dec 2014 in reply to Masha Link to this post

    Hello, same error with your project

    When I launch it, I have these error
     <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/System.Windows.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.GanttView.xaml"/>
    {"Could not load file or assembly 'Telerik.Windows.Themes.VisualStudio2013, Culture=neutral' or one of its dependencies. The system cannot find the file specified.":"Telerik.Windows.Themes.VisualStudio2013, Culture=neutral"}
    If I delete these import, I've this error
    Cannot find resource named 'MilestoneContainerStyle'. Resource names are case sensitive."

    Thanks for your help

    Julien Gourdon

  5. Masha
    Admin
    Masha avatar
    355 posts

    Posted 04 Dec 2014 Link to this post

    Hi Julien,

    I guest you are using Xaml binaries and this is the cause of the error
    In the attached project the implicit styles approach and NoXaml binaries are used. In that case you  don't need to copy the whole styles and all resources because they have been inherited from the merged resource dictionaries. I've updated the project where I've included the GanttView resources.

    Please take a look and let me know if this helps.

    Regards,
    Masha
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top