This is a migrated thread and some comments may be shown as answers.

reference to default template in my project

3 Answers 167 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 1
Julien asked on 02 Dec 2014, 03:13 PM
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






3 Answers, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 03 Dec 2014, 10:01 AM
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.

 
0
Julien
Top achievements
Rank 1
answered on 03 Dec 2014, 01:35 PM
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

0
Masha
Telerik team
answered on 04 Dec 2014, 01:52 PM
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.

 
Tags
GanttView
Asked by
Julien
Top achievements
Rank 1
Answers by
Masha
Telerik team
Julien
Top achievements
Rank 1
Share this question
or