Forge
deeb25a2
1<UserControl xmlns="https://github.com/avaloniaui"
2 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3 xmlns:vm="using:CascadeIDE.ViewModels"
4 xmlns:views="using:CascadeIDE.Views"
5 x:Class="CascadeIDE.Views.DebugStackMfdPageView"
6 x:DataType="vm:MainWindowViewModel">
7 <!-- Страница Mfd «Отладка · стек / Locals»; DataContext — MainWindowViewModel (как у соседних Mfd-страниц). -->
8 <Grid RowDefinitions="Auto,2*,4,Auto,3*" Margin="0,4,0,0">
9 <views:PanelChromeHeader Grid.Row="0" Classes="terminal" Title="Стек вызовов · отладчик" UppercaseTitle="True"/>
10 <ListBox Grid.Row="1"
11 ItemsSource="{Binding InstrumentationPanel.DebugStackFrames}"
12 SelectedIndex="{Binding DebugStackSelectedIndex, Mode=TwoWay}"
13 BorderThickness="0"
14 Background="Transparent"
15 Padding="0,4,0,0"
16 MinHeight="48">
17 <ListBox.Styles>
18 <Style Selector="ListBoxItem:selected">
19 <Setter Property="Background" Value="#3040A0E0"/>
20 </Style>
21 <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
22 <Setter Property="Background" Value="#2040A0E0"/>
23 </Style>
24 </ListBox.Styles>
25 <ListBox.ItemTemplate>
26 <DataTemplate DataType="vm:DebugStackFrameViewModel">
27 <Grid ColumnDefinitions="28,*" Margin="0,0,0,2">
28 <TextBlock Grid.Column="0"
29 Text="{Binding FrameIndexText}"
30 Opacity="0.55"
31 VerticalAlignment="Top"
32 FontFamily="Consolas,monospace"
33 FontSize="11"
34 Foreground="{DynamicResource CascadeTheme.TerminalForeground}"/>
35 <StackPanel Grid.Column="1" Spacing="2">
36 <TextBlock Text="{Binding Name}"
37 FontWeight="SemiBold"
38 FontSize="12"
39 TextWrapping="Wrap"
40 Foreground="{DynamicResource CascadeTheme.TerminalForeground}"/>
41 <TextBlock Text="{Binding LocationText}"
42 FontSize="10.5"
43 Opacity="0.8"
44 TextWrapping="Wrap"
45 FontFamily="Consolas,monospace"
46 Foreground="{DynamicResource CascadeTheme.TerminalForeground}"/>
47 </StackPanel>
48 </Grid>
49 </DataTemplate>
50 </ListBox.ItemTemplate>
51 </ListBox>
52 <views:PanelChromeHeader Grid.Row="3" Classes="terminal" Title="Локальные · выбранный кадр" UppercaseTitle="True" Margin="0,8,0,0"/>
53 <ScrollViewer Grid.Row="4" VerticalScrollBarVisibility="Auto">
54 <StackPanel>
55 <Grid ColumnDefinitions="*,100,*"
56 Margin="0,0,0,4"
57 Opacity="0.75">
58 <TextBlock Grid.Column="0" Text="Имя" FontSize="10" FontWeight="SemiBold" Foreground="{DynamicResource CascadeTheme.TerminalForeground}"/>
59 <TextBlock Grid.Column="1" Text="Тип" FontSize="10" FontWeight="SemiBold" Foreground="{DynamicResource CascadeTheme.TerminalForeground}"/>
60 <TextBlock Grid.Column="2" Text="Значение" FontSize="10" FontWeight="SemiBold" Foreground="{DynamicResource CascadeTheme.TerminalForeground}"/>
61 </Grid>
62 <TreeView x:CompileBindings="False"
63 ItemsSource="{Binding InstrumentationPanel.DebugVariableRoots}"
64 MinHeight="48">
65 <TreeView.Styles>
66 <Style Selector="TreeViewItem">
67 <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
68 </Style>
69 </TreeView.Styles>
70 <TreeView.ItemTemplate>
71 <TreeDataTemplate ItemsSource="{Binding Children}" x:DataType="vm:DebugVariableNodeViewModel">
72 <Panel>
73 <StackPanel IsVisible="{Binding IsScope}" Spacing="0" Margin="0,4,0,2">
74 <TextBlock Text="{Binding SectionTitle}"
75 FontWeight="SemiBold"
76 FontSize="11"
77 Foreground="{DynamicResource CascadeTheme.TerminalForeground}"/>
78 </StackPanel>
79 <Border IsVisible="{Binding IsPlaceholder}" Height="0" Padding="0" Margin="0"/>
80 <Grid IsVisible="{Binding IsVariableRow}" ColumnDefinitions="*,100,*" ColumnSpacing="8" Margin="0,1,0,2">
81 <TextBlock Grid.Column="0"
82 Text="{Binding NamePart}"
83 TextWrapping="Wrap"
84 MinWidth="60"
85 ToolTip.Tip="{Binding NamePart}"
86 FontFamily="Consolas,monospace"
87 FontSize="11"
88 Foreground="{DynamicResource CascadeTheme.TerminalForeground}"/>
89 <TextBlock Grid.Column="1"
90 Text="{Binding TypePart}"
91 TextWrapping="Wrap"
92 TextTrimming="CharacterEllipsis"
93 MaxWidth="120"
94 ToolTip.Tip="{Binding TypePart}"
95 Opacity="0.9"
96 FontFamily="Consolas,monospace"
97 FontSize="10.5"
98 Foreground="{DynamicResource CascadeTheme.TerminalForeground}"/>
99 <TextBlock Grid.Column="2"
100 Text="{Binding Value}"
101 TextWrapping="Wrap"
102 MinWidth="40"
103 FontFamily="Consolas,monospace"
104 FontSize="11"
105 Foreground="{DynamicResource CascadeTheme.TerminalForeground}"/>
106 </Grid>
107 </Panel>
108 </TreeDataTemplate>
109 </TreeView.ItemTemplate>
110 </TreeView>
111 </StackPanel>
112 </ScrollViewer>
113 </Grid>
114</UserControl>
115
View only · write via MCP/CIDE