Hi all,
Excuse for my poor english, i'm a french user. We planned to buy Telerik WPF components to use them in our VS 2008 projects, but i need to check first if they're fully compatible with my actual code.
I followed an article from Code Project, using theViewModelPattern to feed my treeview. That's ok with the basic treeview from vs 2008, but the basic treeview doesn't implement Drag and drop operations, so i have to test yours. I would like to use your treeview instead of microsoft one but without rewriting my code behind and classes, just by rewriting my xaml.I have tried a lot of thing but i couldn't manage to plug my actual code with your treeview.
My "classic" code working with microsoft treeview:
Thanks for your reply. I've already try the carousel component and the grid view too, i'm fully satisfied.
Excuse for my poor english, i'm a french user. We planned to buy Telerik WPF components to use them in our VS 2008 projects, but i need to check first if they're fully compatible with my actual code.
I followed an article from Code Project, using theViewModelPattern to feed my treeview. That's ok with the basic treeview from vs 2008, but the basic treeview doesn't implement Drag and drop operations, so i have to test yours. I would like to use your treeview instead of microsoft one but without rewriting my code behind and classes, just by rewriting my xaml.I have tried a lot of thing but i couldn't manage to plug my actual code with your treeview.
My "classic" code working with microsoft treeview:
<UserControl |
x:Class="Window2" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:local="clr-namespace:XXX.XXX.LoadOnDemand" Background="Transparent"> |
<DockPanel> |
<TextBlock DockPanel.Dock="Bottom" TextWrapping="Wrap" FontSize="12"> |
<Image Source="/XXX;component/LoadOnDemand/Images/logo.png" Height="120" Width="160"></Image> |
</TextBlock> |
<TreeView ItemsSource="{Binding Regions}" Background="Transparent" BorderThickness="0" x:Name="MonTreeview"> |
<TreeView.ItemContainerStyle> |
<!-- |
This Style binds a TreeViewItem to a TreeViewItemViewModel. |
--> |
<Style TargetType="{x:Type TreeViewItem}"> |
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> |
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> |
<Setter Property="FontWeight" Value="Normal" /> |
<Style.Triggers> |
<Trigger Property="IsSelected" Value="True"> |
<Setter Property="FontWeight" Value="Bold" /> |
</Trigger> |
</Style.Triggers> |
</Style> |
</TreeView.ItemContainerStyle> |
<TreeView.Resources> |
<HierarchicalDataTemplate |
DataType="{x:Type local:affaireModel}" |
ItemsSource="{Binding Children}" |
> |
<StackPanel Orientation="Horizontal"> |
<Image Width="16" Height="16" Margin="3,0" Source="Images\Region.png" /> |
<TextBlock Text="{Binding AffaireName}" /> |
</StackPanel> |
</HierarchicalDataTemplate> |
<HierarchicalDataTemplate |
DataType="{x:Type local:StateViewModel}" |
ItemsSource="{Binding Children}" |
> |
<StackPanel Orientation="Horizontal"> |
<Image Width="16" Height="16" Margin="3,0" Source="Images\State.png" /> |
<TextBlock Text="{Binding ChapitreAffaireName}" /> |
</StackPanel> |
</HierarchicalDataTemplate> |
<DataTemplate DataType="{x:Type local:maTacheModel}"> |
<StackPanel Orientation="Horizontal"> |
<Image Width="16" Height="16" Margin="3,0" Source="Images\City.png" /> |
<TextBlock Text="{Binding TacheName}" /> |
</StackPanel> |
</DataTemplate> |
</TreeView.Resources> |
</TreeView> |
<Label Height="66" Name="Label1" Width="149">Label</Label> |
</DockPanel> |
</UserControl> |