Files
2022-12-22 12:13:27 +01:00

85 lines
4.1 KiB
XML

<UserControl x:Class="AssemblyManagerV"
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:EgtDOORCreator="clr-namespace:EgtDOORCreator"
Height="30">
<UserControl.Resources>
<EgtDOORCreator:PathConverter x:Key="PathConverter"/>
<!--<EgtDOORCreator:CurrentNameConverter x:Key="CurrentNameConverter"/>-->
<EgtDOORCreator:ProjectVisibilityConverter x:Key="ProjectVisibilityConverter"/>
</UserControl.Resources>
<!--Visibility="{Binding CurrProject.Name, Converter={StaticResource ProjectVisibilityConverter}, UpdateSourceTrigger=PropertyChanged}"-->
<Grid IsEnabled="{Binding EnableAssebmlyManager}"
Visibility="{Binding VisibilityDoorList}">
<Grid.RowDefinitions>
<RowDefinition Height="18*"/>
<RowDefinition Height="18*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ListBox PreviewMouseWheel="ListBox_PreviewMouseWheel"
ItemsSource="{Binding CurrProject.AssemblyList}"
SelectedItem="{Binding CurrProject.SelAssemblyName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource DoorListBox}" Name="AssemblyList" Grid.ColumnSpan="2" Margin="0,0,28,0.4" Grid.RowSpan="2">
<!--SelectionChanged="AssemblyList_SelectedItem"-->
<Interactivity:Interaction.Behaviors>
<EgtDOORCreator:ScrollIntoViewForListBox/>
</Interactivity:Interaction.Behaviors>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Name="MyVirtual" IsItemsHost="True" Orientation="Horizontal" VirtualizationMode="Recycling"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<ContentPresenter/>
</ControlTemplate>
</Setter.Value>
</Setter>
<EventSetter Event="PreviewMouseLeftButtonUp" Handler="Door_MouseLeftButtonUp"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<RadioButton GroupName="DoorGroup"
Height="28" MaxWidth="150" Margin="0,0,2,0" Padding="5,0,5,0"
Style="{StaticResource {x:Type ToggleButton}}"
IsChecked="{Binding Path=IsSelected, RelativeSource={
RelativeSource AncestorType={x:Type ListBoxItem}}}">
<RadioButton.Content>
<TextBlock Text="{Binding GraphicName}"/>
</RadioButton.Content>
</RadioButton>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Grid.Column="1"
Height="20" Width="20" VerticalAlignment="Center"
Margin="3,5,5,5.4" Command="{Binding AddAssembly_Command}"
ToolTip="{Binding AddNewDoorToolTip}"
Focusable="False" Grid.RowSpan="2">
<Image Source="/Resources/TopCommandBar/Add.png" Stretch="Uniform"/>
<!--<Image Source="/Resources/TopCommandBar/NewFile.png" Stretch="Uniform"/>-->
</Button>
<Button Grid.Column="2"
Height="20" Width="20" VerticalAlignment="Center"
Margin="0,5,4.8,5.4" Command="{Binding RemoveAssembly_Command}"
ToolTip="{Binding RemoveDoorToolTip}"
Focusable="False" Grid.RowSpan="2">
<Image Source="/Resources/TopCommandBar/Remove.png" Stretch="Uniform"/>
<!--<Image Source="/Resources/TopCommandBar/Delete.png" Stretch="Uniform"/>-->
</Button>
</Grid>
</UserControl>