alielie
2026-09-10 9ec80cafc23f5ee3278cacce3c9f86f4087b435a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<UserControl x:Class="OpenTapEditor.DebuggerBtn"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:OpenTapEditor"
             x:Name="self"
             mc:Ignorable="d">
    <UserControl.Template>
        <ControlTemplate TargetType="local:DebuggerBtn">
            <Border x:Name="border" MouseDown="border_MouseDown" 
                    Cursor="Hand" Background="Transparent"
                    Margin="0" Padding="0" Width="16" Height="16" CornerRadius="10" VerticalAlignment="Center"
HorizontalAlignment="Center">
                <TextBlock x:Name="tb" FontSize="10" VerticalAlignment="Center"
   Padding="0"
       HorizontalAlignment="Center"  Foreground="#FFF"/>
            </Border>
 
            <ControlTemplate.Triggers>
                <Trigger Property="InDebug" Value="True">
                    <Setter TargetName="border" Property="Background" Value="Red"/>
                </Trigger>
                <Trigger Property="IsCurrent" Value="True">
                    <Setter TargetName="border" Property="Background" Value="Orange"/>
                    <Setter TargetName="tb" Property="Text" Value="⏸️"/>
                </Trigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsCurrent" Value="True"/>
                        <Condition Property="Running" Value="True"/>
                    </MultiTrigger.Conditions>
                    <MultiTrigger.Setters>
                        <Setter TargetName="border" Property="Background" Value="Orange"/>
                        <Setter TargetName="tb" Property="Text" Value="▶"/>
                    </MultiTrigger.Setters>
                </MultiTrigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </UserControl.Template>
</UserControl>