2021-09-20 18:20:01 +02:00

69 lines
4.5 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.Scripting.Roslyn.Common.ScriptControl"
x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mvvm="clr-namespace:dnSpy.Contracts.MVVM;assembly=dnSpy.Contracts.DnSpy"
xmlns:img="clr-namespace:dnSpy.Contracts.Images;assembly=dnSpy.Contracts.DnSpy">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0" Background="{DynamicResource EnvironmentCommandBar}" mvvm:InitDataTemplateAP.Initialize="True">
<StackPanel Grid.Column="0" Orientation="Horizontal" img:DsImage.BackgroundBrush="{DynamicResource EnvironmentCommandBarIcon}">
<StackPanel.Resources>
<Style TargetType="{x:Type img:DsImage}" BasedOn="{StaticResource {x:Type img:DsImage}}">
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Control}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
<Setter Property="Opacity" Value="0.30" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Resources>
<Button Margin="5 0 0 0" Focusable="False" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" ToolTipService.ShowOnDisabled="True" Command="{Binding ResetCommand}" ToolTip="{Binding ResetToolTip}">
<img:DsImage ImageReference="{x:Static img:DsImages.Restart}"/>
</Button>
<Button Margin="0 0 0 0" Focusable="False" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" ToolTipService.ShowOnDisabled="True" Command="{Binding ClearCommand}" ToolTip="{Binding ClearScreenToolTip}">
<img:DsImage ImageReference="{x:Static img:DsImages.ClearWindowContent}"/>
</Button>
<Button Margin="0 0 0 0" Focusable="False" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" ToolTipService.ShowOnDisabled="True" Command="{Binding HistoryPreviousCommand}" ToolTip="{Binding HistoryPreviousToolTip}">
<img:DsImage ImageReference="{x:Static img:DsImages.MoveUp}"/>
</Button>
<Button Margin="0 0 0 0" Focusable="False" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" ToolTipService.ShowOnDisabled="True" Command="{Binding HistoryNextCommand}" ToolTip="{Binding HistoryNextToolTip}">
<img:DsImage ImageReference="{x:Static img:DsImages.DownloadNoColor}"/>
</Button>
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
<Button Margin="0 0 0 0" Focusable="False" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" ToolTipService.ShowOnDisabled="True" Command="{Binding SaveCommand}" ToolTip="{Binding SaveToolTip}">
<img:DsImage ImageReference="{x:Static img:DsImages.Save}"/>
</Button>
<CheckBox Margin="0 0 0 0" Focusable="False" Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}" ToolTipService.ShowOnDisabled="True" IsChecked="{Binding WordWrap}" ToolTip="{Binding WordWrapToolTip}">
<img:DsImage ImageReference="{x:Static img:DsImages.WordWrap}"/>
</CheckBox>
</StackPanel>
</Grid>
<ContentPresenter
Grid.Row="1"
Name="textEditorContentPresenter"
mvvm:InitDataTemplateAP.Initialize="True">
</ContentPresenter>
</Grid>
</UserControl>