or
private void grid_AutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e) { if (e.Column.UniqueName.Equals("SpecificColumn", StringComparison.CurrentCultureIgnoreCase)) { e.Column.CellTemplateSelector = // ... point to C# class that returns datatemplate from resource dictionary file
} }As a newbie to WPF I've been struggled with triggers and animations for a while.
This is my element in the information layer:
<telerik:InformationLayer.ItemTemplate> <DataTemplate> <Grid x:Name="TopLevelGrid" Width="Auto" Height="Auto" telerik:MapLayer.Location="{Binding Location}" telerik:MapLayer.BaseZoomLevel="9"> <ToolTipService.ToolTip><ToolTip><ToolTip.Content> ... </ToolTip.Content></ToolTip></ToolTipService.ToolTip> <Ellipse Name="myEllipse" Width="20" Height="20" Stroke="{Binding Stroke}" StrokeThickness="3"StrokeDashArray="2" Fill="{Binding Fill}" Style="{StaticResource myStyle}" > <telerik:MapLayer.HotSpot><telerik:HotSpot X="0.5" Y="0.5" /></telerik:MapLayer.HotSpot> </Ellipse> </Grid> </DataTemplate> </telerik:InformationLayer.ItemTemplate>
The problem is that I want a property (or event) in my custom class for the element to trigger the animation. So far I've tried to do it both in XAML and in code without success.
I would be grateful if you could give me a hint or two of how to solve the issue.
Regards
Robert
<Window x:Class="RadControlsWpfApp1.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525" telerik:RadDragAndDropManager.DragQuery="Window_DragQuery"> <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <telerik:RadGallery> <telerik:RadGalleryItem telerik:RadDragAndDropManager.AllowDrag="True" Image="/RadControlsWpfApp1;component/PDF-04.png"></telerik:RadGalleryItem> </telerik:RadGallery> <Image Source="/RadControlsWpfApp1;component/PDF-04.png" Grid.Row="1" telerik:RadDragAndDropManager.AllowDrag="True"/> </Grid></Window>using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;namespace RadControlsWpfApp1{ /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void Window_DragQuery(object sender, Telerik.Windows.Controls.DragDrop.DragDropQueryEventArgs e) { MessageBox.Show("draged"); } }}