Dnspy/Extensions/dnSpy.AsmEditor/DnlibDialogs/CustomAttributeControl.xaml
2021-09-20 18:20:01 +02:00

73 lines
4.0 KiB
XML

<!--
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
-->
<UserControl x:Class="dnSpy.AsmEditor.DnlibDialogs.CustomAttributeControl"
x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dnlibdlgs="clr-namespace:dnSpy.AsmEditor.DnlibDialogs"
xmlns:mvvm="clr-namespace:dnSpy.Contracts.MVVM;assembly=dnSpy.Contracts.DnSpy"
xmlns:p="clr-namespace:dnSpy.AsmEditor.Properties">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="0" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Style="{StaticResource EllipsisButton}" Command="{Binding PickConstructorCommand}" ToolTip="{x:Static p:dnSpy_AsmEditor_Resources.Pick_Constructor}" />
<TextBox Grid.Column="1" Margin="5 0 0 0" IsReadOnly="True" Background="Transparent" Text="{Binding Constructor.FullName, Mode=OneWay}" />
</Grid>
<Grid Grid.Row="1" Margin="0 5 0 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox Grid.Column="0" Margin="0 0 0 0" VerticalAlignment="Center" IsChecked="{Binding IsRawData}" Content="{x:Static p:dnSpy_AsmEditor_Resources.RawCustomAttributeBlob}" />
<TextBox Grid.Column="1" Margin="5 0 0 0" Text="{Binding RawData.StringValue, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding IsRawData}" />
</Grid>
<GroupBox Grid.Row="2" Margin="0 5 0 0" Header="{x:Static p:dnSpy_AsmEditor_Resources.ConstructorArguments}">
<ListBox Grid.Row="0"
Margin="0 5 0 0"
HorizontalContentAlignment="Stretch"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectionMode="Single"
mvvm:AutomationPeerMemoryLeakWorkaround.Initialize="True"
IsEnabled="{Binding IsNotRawData}"
ItemsSource="{Binding ConstructorArguments}"
SelectedIndex="{Binding ConstructorArguments.SelectedIndex}">
<ListBox.ItemTemplate>
<DataTemplate>
<dnlibdlgs:ConstantTypeControl Margin="0 2 0 2" DataContext="{Binding ConstantTypeVM}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
<GridSplitter Grid.Row="3" Grid.ZIndex="1" Margin="0 -2 0 -5" BorderThickness="0 2 0 5" BorderBrush="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Center" Focusable="False"/>
<GroupBox Grid.Row="4" Margin="0 5 0 0" Header="{x:Static p:dnSpy_AsmEditor_Resources.NamedArguments}">
<dnlibdlgs:CANamedArgumentsControl DataContext="{Binding CANamedArgumentsVM}" />
</GroupBox>
</Grid>
</UserControl>