6dd2abf95d
- Altri nomi modificati. - Eliminato namespace.
75 lines
4.0 KiB
XML
75 lines
4.0 KiB
XML
<UserControl x:Class="MachiningTreeExpanderV"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
|
xmlns:local="clr-namespace:EgtCAM5">
|
|
|
|
<Expander Header="{Binding MachListHdr}" IsExpanded="{Binding IsEnabled}" IsEnabled="{Binding IsEnabled}"
|
|
Style="{StaticResource ExpanderStyle}">
|
|
<UniformGrid MaxHeight="100">
|
|
<TreeView Name="MachiningsTreeView" Grid.Row="1"
|
|
ItemsSource="{Binding Path=MachiningsList}">
|
|
<!--<interactivity:Interaction.Triggers>
|
|
<interactivity:EventTrigger EventName="MouseDoubleClick">
|
|
<interactivity:InvokeCommandAction Command="{Binding TreeViewDoubleClickCommand}" CommandParameter="{Binding ElementName=MachiningsTreeView,Path=SelectedItem}"/>
|
|
</interactivity:EventTrigger>
|
|
</interactivity:Interaction.Triggers>-->
|
|
<TreeView.InputBindings>
|
|
<KeyBinding Key="Escape" Command="{Binding CancelNewCommand}" CommandParameter="Escape"/>
|
|
</TreeView.InputBindings>
|
|
<TreeView.Resources>
|
|
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
|
|
<!--renderlo apribile con un solo click -->
|
|
<HierarchicalDataTemplate DataType="{x:Type local:FamilyMachiningTreeViewExpanderItem}" ItemsSource="{Binding Items}">
|
|
|
|
<Grid >
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="1*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Image Grid.Column="0" Source="{Binding PictureString}" Height="15" Margin="0,0,5,0"/>
|
|
<TextBlock Grid.Column="1" Text="{Binding Name}"/>
|
|
|
|
</Grid>
|
|
|
|
<!--Assegna ai nodi ToolItem lo Style normale dei TreeViewItem, eliminando l'ombra, data dal
|
|
multibinding quando sono attivi.-->
|
|
<HierarchicalDataTemplate.ItemContainerStyle>
|
|
<Style TargetType="{x:Type TreeViewItem}" >
|
|
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
<EventSetter Event="MouseDoubleClick" Handler="MachiningsTreeView_MouseDoubleClick"/>
|
|
</Style>
|
|
</HierarchicalDataTemplate.ItemContainerStyle>
|
|
|
|
</HierarchicalDataTemplate>
|
|
<!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo-->
|
|
<DataTemplate DataType="{x:Type local:MachiningTreeViewExpanderItem}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="1*"/>
|
|
<ColumnDefinition Width="1*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Grid.Column="0" Text="{Binding Name}" Margin="0,0,5,0"/>
|
|
<TextBlock Grid.Column="1" Text="{Binding Tool}"/>
|
|
|
|
</Grid>
|
|
</DataTemplate>
|
|
</TreeView.Resources>
|
|
|
|
<!--Style dei nodi CathegoryItem che li riquadra di azzurro quando clicckati ed elimina l'ombra grigia -->
|
|
<!--che si presenta quando la categoria rimane vuota (ombra causata dal multibinding). -->
|
|
<TreeView.ItemContainerStyle>
|
|
<Style TargetType="{x:Type TreeViewItem}">
|
|
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
</Style>
|
|
</TreeView.ItemContainerStyle>
|
|
|
|
</TreeView>
|
|
</UniformGrid>
|
|
</Expander>
|
|
|
|
</UserControl>
|