<UserControl x:Class="LogiBoardToolBox.Controls.MacroEditorView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:LogiBoardToolBox.Controls">
<UserControl.Resources><Style x:Key="TypeButton" TargetType="Button"><Setter Property="Background" Value="#181818"/><Setter Property="Foreground" Value="White"/><Setter Property="BorderBrush" Value="#444444"/><Setter Property="BorderThickness" Value="1"/><Setter Property="CornerRadius" Value="2"/><Setter Property="Width" Value="28"/><Setter Property="Height" Value="24"/><Setter Property="MinHeight" Value="0"/><Setter Property="Padding" Value="0"/><Setter Property="FontSize" Value="20"/></Style></UserControl.Resources>
<Grid Background="Black">
<Button Background="Transparent" BorderThickness="0" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="12,26,0,0" Width="36" Click="Back_Click" AutomationProperties.Name="返回"><PathIcon Style="{StaticResource AppVectorIcon}" Data="M 2,9 L 9,2 L 10.1,3.1 L 5,8.2 H 18 V 9.8 H 5 L 10.1,14.9 L 9,16 Z"/></Button>
<StackPanel x:Name="NamingPanel" Visibility="Collapsed" Width="640" VerticalAlignment="Center" Spacing="24"><TextBox x:Name="MacroNameField" Text="{Binding SelectedMacro.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" PlaceholderText="为宏命名" FontSize="30" FontWeight="Bold" TextAlignment="Center" Background="Transparent" BorderThickness="0,0,0,1" BorderBrush="#777777" Padding="0,16" KeyDown="MacroName_KeyDown"/><TextBlock Text="为宏命名,然后按 ENTER 继续" FontSize="12" Foreground="#AAAAAA" HorizontalAlignment="Center"/></StackPanel>
<Grid x:Name="TypePanel" Visibility="Collapsed"><TextBlock Text="{Binding SelectedMacro.Name}" FontSize="20" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,110,0,0"/><StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="40"><TextBlock Text="选择要创建的宏类型" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/><StackPanel Orientation="Horizontal" Spacing="38">
<StackPanel Spacing="18"><Button Tag="0" Style="{StaticResource TypeButton}" Width="96" Height="96" FontSize="30" Click="ChooseType_Click"><local:MacroTypeIcon Kind="0"/></Button><TextBlock Text="不重复" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/></StackPanel><StackPanel Spacing="18"><Button Tag="1" Style="{StaticResource TypeButton}" Width="96" Height="96" FontSize="30" Click="ChooseType_Click"><local:MacroTypeIcon Kind="1"/></Button><TextBlock Text="按住时重复" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/></StackPanel><StackPanel Spacing="18"><Button Tag="2" Style="{StaticResource TypeButton}" Width="96" Height="96" FontSize="30" Click="ChooseType_Click"><local:MacroTypeIcon Kind="2"/></Button><TextBlock Text="触发" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/></StackPanel><StackPanel Spacing="18"><Button Tag="3" Style="{StaticResource TypeButton}" Width="96" Height="96" FontSize="30" Click="ChooseType_Click"><local:MacroTypeIcon Kind="3"/></Button><TextBlock Text="序列" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/></StackPanel>
<StackPanel Spacing="18">
<Button Tag="4" Style="{StaticResource TypeButton}" Width="96" Height="96" Click="ChooseType_Click" AutomationProperties.Name="持续循环"><local:MacroTypeIcon Kind="4"/></Button>
<TextBlock Text="持续循环" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/>
</StackPanel>
</StackPanel></StackPanel></Grid>
<Grid x:Name="EditorPanel" MaxWidth="1024" Margin="64,88,64,24"><Grid.RowDefinitions><RowDefinition Height="Auto" MinHeight="178"/><RowDefinition Height="*"/><RowDefinition Height="Auto"/></Grid.RowDefinitions>
<Grid><Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="248"/></Grid.ColumnDefinitions><StackPanel Spacing="8"><TextBox Text="{Binding SelectedMacro.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" FontWeight="Bold" BorderThickness="0" Background="Transparent" Padding="0" MinHeight="28"/><StackPanel Orientation="Horizontal" Spacing="6"><TextBlock Text="宏类型" FontSize="12" VerticalAlignment="Center" Margin="0,0,8,0"/><Button x:Name="OnceType" Tag="0" Style="{StaticResource TypeButton}" Click="Type_Click" ToolTipService.ToolTip="不重复"><local:MacroTypeIcon Kind="0"/></Button><Button x:Name="RepeatType" Tag="1" Style="{StaticResource TypeButton}" Click="Type_Click" ToolTipService.ToolTip="按住时重复"><local:MacroTypeIcon Kind="1"/></Button><Button x:Name="ToggleType" Tag="2" Style="{StaticResource TypeButton}" Click="Type_Click" ToolTipService.ToolTip="触发"><local:MacroTypeIcon Kind="2"/></Button><Button x:Name="SequenceType" Tag="3" Style="{StaticResource TypeButton}" Click="Type_Click" ToolTipService.ToolTip="序列"><local:MacroTypeIcon Kind="3"/></Button>
<Button x:Name="ContinuousType" Tag="4" Style="{StaticResource TypeButton}" Click="Type_Click" ToolTipService.ToolTip="持续循环" AutomationProperties.Name="持续循环" AutomationProperties.AutomationId="macro-type-continuous"><local:MacroTypeIcon Kind="4"/></Button>
<Button Content="板载与执行" FontSize="11" Background="Transparent" BorderThickness="0" Padding="12,0"><Button.Flyout><Flyout><ScrollViewer MaxHeight="600"><StackPanel Width="360" Spacing="12"><TextBlock Text="{x:Bind ViewModel.MacroTypeDescription, Mode=OneWay}" TextWrapping="Wrap" FontSize="12"/><Button Content="检查板载兼容性" Command="{x:Bind ViewModel.CompileMacroCommand}"/><TextBlock Text="{x:Bind ViewModel.MacroPreview, Mode=OneWay}" TextWrapping="Wrap" FontSize="12"/><ComboBox Header="绑定目标" ItemsSource="{x:Bind ViewModel.AllBindings, Mode=OneWay}" SelectedItem="{x:Bind ViewModel.MacroTarget, Mode=TwoWay}" HorizontalAlignment="Stretch"/><Button Content="绑定到按键" Command="{x:Bind ViewModel.BindMacroCommand}"/><Button Content="启动软件宏" Command="{x:Bind ViewModel.StartSoftwareMacrosCommand}" IsEnabled="{x:Bind ViewModel.CanStartSoftware, Mode=OneWay}"/><ComboBox Header="Lua 导出触发事件" ItemsSource="{x:Bind ViewModel.LuaBoardTriggers}" DisplayMemberPath="Label" SelectedItem="{x:Bind ViewModel.LuaBoardTrigger, Mode=TwoWay}" HorizontalAlignment="Stretch"/><Button AutomationProperties.AutomationId="macro-export-lua" Content="导出为 .lua" Click="ExportLua_Click"/><Button Content="停止软件宏" Command="{x:Bind ViewModel.StopSoftwareMacrosCommand}" IsEnabled="{x:Bind ViewModel.HostMacrosRunning, Mode=OneWay}"/><TextBlock Text="{x:Bind ViewModel.SoftwareMacroStatus, Mode=OneWay}" TextWrapping="Wrap" FontSize="12"/><Button Content="模拟按住 300 ms" Command="{x:Bind ViewModel.TestMacroCommand}"/><TextBlock Text="{x:Bind ViewModel.MacroExecutionTrace, Mode=OneWay}" TextWrapping="Wrap" FontSize="11"/><Expander Header="高级文本编辑"><StackPanel Spacing="8"><TextBox Header="点击" AcceptsReturn="True" Text="{Binding SelectedMacro.Script, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/><TextBox Header="按住" AcceptsReturn="True" Text="{Binding SelectedMacro.HoldScript, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/><TextBox Header="松开" AcceptsReturn="True" Text="{Binding SelectedMacro.ReleaseScript, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/></StackPanel></Expander></StackPanel></ScrollViewer></Flyout></Button.Flyout></Button>
</StackPanel>
<TextBlock Visibility="{x:Bind ViewModel.ShowMacroLoopHint, Mode=OneWay}" Text="{x:Bind ViewModel.MacroTypeDescription, Mode=OneWay}" Foreground="#AAAAAA" FontSize="12" TextWrapping="Wrap" Margin="0,6,12,0"/>
<StackPanel Visibility="{x:Bind ViewModel.ShowSoftwareToggleHint, Mode=OneWay}" Spacing="6" Margin="0,6,12,0">
<TextBlock x:Name="ToggleCompatibilityHint" AutomationProperties.AutomationId="macro-toggle-compatibility" Text="板载同键触发尚未支持,当前选择不会写成持续循环或按住循环。可切换到软件配置,按一次开始、再按一次停止。" Foreground="#F3C76B" FontSize="12" TextWrapping="Wrap"/>
<Button AutomationProperties.AutomationId="macro-use-software" Content="切换到软件配置" Command="{x:Bind ViewModel.UseSoftwareMacroConfigurationCommand}" FontSize="11" Padding="8,3" MinHeight="24"/>
</StackPanel>
<TextBlock AutomationProperties.AutomationId="macro-save-error" Text="{x:Bind ViewModel.Status, Mode=OneWay}" Visibility="{x:Bind ViewModel.HasError, Mode=OneWay}" Foreground="#FF9A9A" FontSize="12" TextWrapping="Wrap" Margin="0,6,12,10"/>
<Button x:Name="StopRecordingButton" AutomationProperties.AutomationId="macro-record-stop" Content="● 停止录制" Visibility="{x:Bind ViewModel.IsRecording, Mode=OneWay}" Background="#4C0C1E" Foreground="White" BorderThickness="0" Click="Record_Click" HorizontalAlignment="Left" FontSize="12"/></StackPanel>
<StackPanel Grid.Column="1" Spacing="6"><Grid><Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="50"/><ColumnDefinition Width="28"/></Grid.ColumnDefinitions><CheckBox Content="使用标准延迟" IsChecked="{Binding SelectedMacro.UseStandardDelay, Mode=TwoWay}" FontSize="11" MinHeight="24"/><TextBox Grid.Column="1" Text="{Binding SelectedMacro.StandardDelay, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Background="Transparent" BorderThickness="0" FontSize="11" MinHeight="24" Padding="0,4"/><TextBlock Grid.Column="2" Text="毫秒" FontSize="11" VerticalAlignment="Center"/></Grid><TextBlock Text="两次操作间有标准延迟" Margin="24,0,0,0" FontSize="11"/><CheckBox Content="显示按键按下/抬起" IsChecked="{Binding SelectedMacro.ShowUpDown, Mode=TwoWay}" FontSize="11" MinHeight="28"/><Button Background="Transparent" BorderThickness="0" Padding="0" Height="24" MinHeight="0" HorizontalAlignment="Left"><StackPanel Orientation="Horizontal" Spacing="8"><Ellipse Width="14" Height="14" Fill="{Binding SelectedMacro.ColorBrush}"/><TextBlock Text="宏颜色" FontSize="11"/></StackPanel><Button.Flyout><Flyout><ColorPicker IsAlphaEnabled="False" ColorChanged="MacroColor_Changed"/></Flyout></Button.Flyout></Button><TextBlock Text="{x:Bind ViewModel.RecordingStatus, Mode=OneWay}" Visibility="{x:Bind ViewModel.IsRecording, Mode=OneWay}" FontSize="11" TextWrapping="Wrap"/></StackPanel>
</Grid>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto"><StackPanel><local:MacroPhaseView Title="点击" Segment="press" ShowUpDown="{Binding SelectedMacro.ShowUpDown}" Script="{Binding SelectedMacro.Script}" RecordRequested="Phase_RecordRequested"/><local:MacroPhaseView Title="按住" Segment="hold" ShowUpDown="{Binding SelectedMacro.ShowUpDown}" Script="{Binding SelectedMacro.HoldScript}" Visibility="{x:Bind ViewModel.IsSequenceMacro, Mode=OneWay}" RecordRequested="Phase_RecordRequested"/><local:MacroPhaseView Title="松开" Segment="release" ShowUpDown="{Binding SelectedMacro.ShowUpDown}" Script="{Binding SelectedMacro.ReleaseScript}" Visibility="{x:Bind ViewModel.IsSequenceMacro, Mode=OneWay}" RecordRequested="Phase_RecordRequested"/></StackPanel></ScrollViewer>
<StackPanel Grid.Row="2" Orientation="Horizontal" Spacing="14" HorizontalAlignment="Center">
<Button x:Name="DeleteButton" AutomationProperties.AutomationId="macro-delete" Content="删除宏" Width="112" Height="28" MinHeight="0" Background="#171717" BorderThickness="0" CornerRadius="0" FontSize="12" Click="Delete_Click"/>
<Button x:Name="ResetButton" Content="重置" Width="160" Height="28" MinHeight="0" Background="#171717" BorderThickness="0" CornerRadius="0" FontSize="12" Click="Reset_Click"/>
<Button x:Name="SaveButton" AutomationProperties.AutomationId="macro-save" Content="保存" Width="160" Height="28" MinHeight="0" Background="#00A9E0" Foreground="Black" BorderThickness="0" CornerRadius="0" FontSize="12" Click="Save_Click"/>
</StackPanel>
</Grid>
</Grid>
</UserControl>
<UserControl x:Class="LogiBoardToolBox.Controls.MacroEditorView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:LogiBoardToolBox.Controls">
<UserControl.Resources><Style x:Key="TypeButton" TargetType="Button"><Setter Property="Background" Value="#181818"/><Setter Property="Foreground" Value="White"/><Setter Property="BorderBrush" Value="#444444"/><Setter Property="BorderThickness" Value="1"/><Setter Property="CornerRadius" Value="2"/><Setter Property="Width" Value="28"/><Setter Property="Height" Value="24"/><Setter Property="MinHeight" Value="0"/><Setter Property="Padding" Value="0"/><Setter Property="FontSize" Value="20"/></Style></UserControl.Resources>
<Grid Background="Black">
<Button Background="Transparent" BorderThickness="0" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="12,26,0,0" Width="36" Click="Back_Click" AutomationProperties.Name="返回"><PathIcon Style="{StaticResource AppVectorIcon}" Data="M 2,9 L 9,2 L 10.1,3.1 L 5,8.2 H 18 V 9.8 H 5 L 10.1,14.9 L 9,16 Z"/></Button>
<StackPanel x:Name="NamingPanel" Visibility="Collapsed" Width="640" VerticalAlignment="Center" Spacing="24"><TextBox x:Name="MacroNameField" Text="{Binding SelectedMacro.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" PlaceholderText="为宏命名" FontSize="30" FontWeight="Bold" TextAlignment="Center" Background="Transparent" BorderThickness="0,0,0,1" BorderBrush="#777777" Padding="0,16" KeyDown="MacroName_KeyDown"/><TextBlock Text="为宏命名,然后按 ENTER 继续" FontSize="12" Foreground="#AAAAAA" HorizontalAlignment="Center"/></StackPanel>
<Grid x:Name="TypePanel" Visibility="Collapsed"><TextBlock Text="{Binding SelectedMacro.Name}" FontSize="20" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,110,0,0"/><StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="40"><TextBlock Text="选择要创建的宏类型" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/><StackPanel Orientation="Horizontal" Spacing="38">
<StackPanel Spacing="18"><Button Tag="0" Style="{StaticResource TypeButton}" Width="96" Height="96" FontSize="30" Click="ChooseType_Click"><local:MacroTypeIcon Kind="0"/></Button><TextBlock Text="不重复" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/></StackPanel><StackPanel Spacing="18"><Button Tag="1" Style="{StaticResource TypeButton}" Width="96" Height="96" FontSize="30" Click="ChooseType_Click"><local:MacroTypeIcon Kind="1"/></Button><TextBlock Text="按住时重复" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/></StackPanel><StackPanel Spacing="18"><Button Tag="2" Style="{StaticResource TypeButton}" Width="96" Height="96" FontSize="30" Click="ChooseType_Click"><local:MacroTypeIcon Kind="2"/></Button><TextBlock Text="触发" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/></StackPanel><StackPanel Spacing="18"><Button Tag="3" Style="{StaticResource TypeButton}" Width="96" Height="96" FontSize="30" Click="ChooseType_Click"><local:MacroTypeIcon Kind="3"/></Button><TextBlock Text="序列" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/></StackPanel>
<StackPanel Spacing="18">
<Button Tag="4" Style="{StaticResource TypeButton}" Width="96" Height="96" Click="ChooseType_Click" AutomationProperties.Name="持续循环"><local:MacroTypeIcon Kind="4"/></Button>
<TextBlock Text="持续循环" FontSize="12" FontWeight="Bold" HorizontalAlignment="Center"/>
</StackPanel>
</StackPanel></StackPanel></Grid>
<Grid x:Name="EditorPanel" MaxWidth="1024" Margin="64,88,64,24"><Grid.RowDefinitions><RowDefinition Height="Auto" MinHeight="178"/><RowDefinition Height="*"/><RowDefinition Height="Auto"/></Grid.RowDefinitions>
<Grid><Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="248"/></Grid.ColumnDefinitions><StackPanel Spacing="8"><TextBox Text="{Binding SelectedMacro.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" FontWeight="Bold" BorderThickness="0" Background="Transparent" Padding="0" MinHeight="28"/><StackPanel Orientation="Horizontal" Spacing="6"><TextBlock Text="宏类型" FontSize="12" VerticalAlignment="Center" Margin="0,0,8,0"/><Button x:Name="OnceType" Tag="0" Style="{StaticResource TypeButton}" Click="Type_Click" ToolTipService.ToolTip="不重复"><local:MacroTypeIcon Kind="0"/></Button><Button x:Name="RepeatType" Tag="1" Style="{StaticResource TypeButton}" Click="Type_Click" ToolTipService.ToolTip="按住时重复"><local:MacroTypeIcon Kind="1"/></Button><Button x:Name="ToggleType" Tag="2" Style="{StaticResource TypeButton}" Click="Type_Click" ToolTipService.ToolTip="触发"><local:MacroTypeIcon Kind="2"/></Button><Button x:Name="SequenceType" Tag="3" Style="{StaticResource TypeButton}" Click="Type_Click" ToolTipService.ToolTip="序列"><local:MacroTypeIcon Kind="3"/></Button>
<Button x:Name="ContinuousType" Tag="4" Style="{StaticResource TypeButton}" Click="Type_Click" ToolTipService.ToolTip="持续循环" AutomationProperties.Name="持续循环" AutomationProperties.AutomationId="macro-type-continuous"><local:MacroTypeIcon Kind="4"/></Button>
<Button Content="板载与执行" FontSize="11" Background="Transparent" BorderThickness="0" Padding="12,0"><Button.Flyout><Flyout><ScrollViewer MaxHeight="600"><StackPanel Width="360" Spacing="12"><TextBlock Text="{x:Bind ViewModel.MacroTypeDescription, Mode=OneWay}" TextWrapping="Wrap" FontSize="12"/><Button Content="检查板载兼容性" Command="{x:Bind ViewModel.CompileMacroCommand}"/><TextBlock Text="{x:Bind ViewModel.MacroPreview, Mode=OneWay}" TextWrapping="Wrap" FontSize="12"/><ComboBox Header="绑定目标" ItemsSource="{x:Bind ViewModel.AllBindings, Mode=OneWay}" SelectedItem="{x:Bind ViewModel.MacroTarget, Mode=TwoWay}" HorizontalAlignment="Stretch"/><Button Content="绑定到按键" Command="{x:Bind ViewModel.BindMacroCommand}"/><Button Content="启动软件宏" Command="{x:Bind ViewModel.StartSoftwareMacrosCommand}" IsEnabled="{x:Bind ViewModel.CanStartSoftware, Mode=OneWay}"/><ComboBox Header="Lua 导出触发事件" ItemsSource="{x:Bind ViewModel.LuaBoardTriggers}" DisplayMemberPath="Label" SelectedItem="{x:Bind ViewModel.LuaBoardTrigger, Mode=TwoWay}" HorizontalAlignment="Stretch"/><Button AutomationProperties.AutomationId="macro-export-lua" Content="导出为 .lua" Click="ExportLua_Click"/><Button Content="停止软件宏" Command="{x:Bind ViewModel.StopSoftwareMacrosCommand}" IsEnabled="{x:Bind ViewModel.HostMacrosRunning, Mode=OneWay}"/><TextBlock Text="{x:Bind ViewModel.SoftwareMacroStatus, Mode=OneWay}" TextWrapping="Wrap" FontSize="12"/><Button Content="模拟按住 300 ms" Command="{x:Bind ViewModel.TestMacroCommand}"/><TextBlock Text="{x:Bind ViewModel.MacroExecutionTrace, Mode=OneWay}" TextWrapping="Wrap" FontSize="11"/><Expander Header="高级文本编辑"><StackPanel Spacing="8"><TextBox Header="点击" AcceptsReturn="True" Text="{Binding SelectedMacro.Script, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/><TextBox Header="按住" AcceptsReturn="True" Text="{Binding SelectedMacro.HoldScript, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/><TextBox Header="松开" AcceptsReturn="True" Text="{Binding SelectedMacro.ReleaseScript, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/></StackPanel></Expander></StackPanel></ScrollViewer></Flyout></Button.Flyout></Button>
</StackPanel>
<TextBlock Visibility="{x:Bind ViewModel.ShowMacroLoopHint, Mode=OneWay}" Text="{x:Bind ViewModel.MacroTypeDescription, Mode=OneWay}" Foreground="#AAAAAA" FontSize="12" TextWrapping="Wrap" Margin="0,6,12,0"/>
<StackPanel Visibility="{x:Bind ViewModel.ShowSoftwareToggleHint, Mode=OneWay}" Spacing="6" Margin="0,6,12,0">
<TextBlock x:Name="ToggleCompatibilityHint" AutomationProperties.AutomationId="macro-toggle-compatibility" Text="板载同键触发尚未支持,当前选择不会写成持续循环或按住循环。可切换到软件配置,按一次开始、再按一次停止。" Foreground="#F3C76B" FontSize="12" TextWrapping="Wrap"/>
<Button AutomationProperties.AutomationId="macro-use-software" Content="切换到软件配置" Command="{x:Bind ViewModel.UseSoftwareMacroConfigurationCommand}" FontSize="11" Padding="8,3" MinHeight="24"/>
</StackPanel>
<TextBlock AutomationProperties.AutomationId="macro-save-error" Text="{x:Bind ViewModel.Status, Mode=OneWay}" Visibility="{x:Bind ViewModel.HasError, Mode=OneWay}" Foreground="#FF9A9A" FontSize="12" TextWrapping="Wrap" Margin="0,6,12,10"/>
<Button x:Name="StopRecordingButton" AutomationProperties.AutomationId="macro-record-stop" Content="● 停止录制" Visibility="{x:Bind ViewModel.IsRecording, Mode=OneWay}" Background="#4C0C1E" Foreground="White" BorderThickness="0" Click="Record_Click" HorizontalAlignment="Left" FontSize="12"/></StackPanel>
<StackPanel Grid.Column="1" Spacing="6"><Grid><Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="50"/><ColumnDefinition Width="28"/></Grid.ColumnDefinitions><CheckBox Content="使用标准延迟" IsChecked="{Binding SelectedMacro.UseStandardDelay, Mode=TwoWay}" FontSize="11" MinHeight="24"/><TextBox Grid.Column="1" Text="{Binding SelectedMacro.StandardDelay, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Background="Transparent" BorderThickness="0" FontSize="11" MinHeight="24" Padding="0,4"/><TextBlock Grid.Column="2" Text="毫秒" FontSize="11" VerticalAlignment="Center"/></Grid><TextBlock Text="两次操作间有标准延迟" Margin="24,0,0,0" FontSize="11"/><CheckBox Content="显示按键按下/抬起" IsChecked="{Binding SelectedMacro.ShowUpDown, Mode=TwoWay}" FontSize="11" MinHeight="28"/><Button Background="Transparent" BorderThickness="0" Padding="0" Height="24" MinHeight="0" HorizontalAlignment="Left"><StackPanel Orientation="Horizontal" Spacing="8"><Ellipse Width="14" Height="14" Fill="{Binding SelectedMacro.ColorBrush}"/><TextBlock Text="宏颜色" FontSize="11"/></StackPanel><Button.Flyout><Flyout><ColorPicker IsAlphaEnabled="False" ColorChanged="MacroColor_Changed"/></Flyout></Button.Flyout></Button><TextBlock Text="{x:Bind ViewModel.RecordingStatus, Mode=OneWay}" Visibility="{x:Bind ViewModel.IsRecording, Mode=OneWay}" FontSize="11" TextWrapping="Wrap"/></StackPanel>
</Grid>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto"><StackPanel><local:MacroPhaseView Title="点击" Segment="press" ShowUpDown="{Binding SelectedMacro.ShowUpDown}" Script="{Binding SelectedMacro.Script}" RecordRequested="Phase_RecordRequested"/><local:MacroPhaseView Title="按住" Segment="hold" ShowUpDown="{Binding SelectedMacro.ShowUpDown}" Script="{Binding SelectedMacro.HoldScript}" Visibility="{x:Bind ViewModel.IsSequenceMacro, Mode=OneWay}" RecordRequested="Phase_RecordRequested"/><local:MacroPhaseView Title="松开" Segment="release" ShowUpDown="{Binding SelectedMacro.ShowUpDown}" Script="{Binding SelectedMacro.ReleaseScript}" Visibility="{x:Bind ViewModel.IsSequenceMacro, Mode=OneWay}" RecordRequested="Phase_RecordRequested"/></StackPanel></ScrollViewer>
<StackPanel Grid.Row="2" Orientation="Horizontal" Spacing="14" HorizontalAlignment="Center">
<Button x:Name="DeleteButton" AutomationProperties.AutomationId="macro-delete" Content="删除宏" Width="112" Height="28" MinHeight="0" Background="#171717" BorderThickness="0" CornerRadius="0" FontSize="12" Click="Delete_Click"/>
<Button x:Name="ResetButton" Content="重置" Width="160" Height="28" MinHeight="0" Background="#171717" BorderThickness="0" CornerRadius="0" FontSize="12" Click="Reset_Click"/>
<Button x:Name="SaveButton" AutomationProperties.AutomationId="macro-save" Content="保存" Width="160" Height="28" MinHeight="0" Background="#00A9E0" Foreground="Black" BorderThickness="0" CornerRadius="0" FontSize="12" Click="Save_Click"/>
</StackPanel>
</Grid>
</Grid>
</UserControl>