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:feat="using:CascadeIDE.Features.Instrumentation"
5 xmlns:models="using:CascadeIDE.Models"
6 xmlns:views="using:CascadeIDE.Views"
7 x:Name="Root"
8 x:Class="CascadeIDE.Views.SolutionExplorerView"
9 Classes.power="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyEq}, ConverterParameter=Power}"
10 Classes.compact="{Binding SolutionExplorerCompactTree}"
11 x:DataType="vm:MainWindowViewModel">
12 <UserControl.Resources>
13 <views:SolutionItemIconConverter x:Key="SolutionItemIconConverter"/>
14 </UserControl.Resources>
15 <UserControl.Styles>
16 <Style Selector="UserControl">
17 <Setter Property="Margin" Value="0"/>
18 </Style>
19 <Style Selector="UserControl.power">
20 <Setter Property="Margin" Value="8,6,6,6"/>
21 </Style>
22 <Style Selector="Border#SolutionIslandInner">
23 <Setter Property="Background" Value="{DynamicResource CascadeTheme.MainWindowBackground}"/>
24 <Setter Property="BorderBrush" Value="{DynamicResource CascadeTheme.WorkspacePanelBorderBrush}"/>
25 <Setter Property="BorderThickness" Value="1"/>
26 <Setter Property="CornerRadius" Value="4"/>
27 <Setter Property="Padding" Value="4"/>
28 </Style>
29 <Style Selector="Border#SolutionIslandInner.power">
30 <Setter Property="Background" Value="{DynamicResource CascadeTheme.PowerSolutionTreePanelBackground}"/>
31 <Setter Property="BorderThickness" Value="0"/>
32 <Setter Property="CornerRadius" Value="12"/>
33 <Setter Property="Margin" Value="2"/>
34 <Setter Property="BoxShadow" Value="0 0 18 0 #3300A8CC, 0 3 14 0 #22000000"/>
35 </Style>
36 <Style Selector="TreeView TreeViewItem TextBlock">
37 <Setter Property="Foreground" Value="{DynamicResource CascadeTheme.SolutionExplorerHeaderForeground}"/>
38 </Style>
39 <Style Selector="UserControl.power TreeView TreeViewItem TextBlock">
40 <Setter Property="Foreground" Value="{DynamicResource CascadeTheme.PowerSolutionTreeForeground}"/>
41 </Style>
42 <Style Selector="UserControl.power TreeView TreeViewItem">
43 <Setter Property="Padding" Value="4,6"/>
44 <Setter Property="MinHeight" Value="32"/>
45 </Style>
46 <Style Selector="UserControl.power TreeView TreeViewItem:pointerover">
47 <Setter Property="Background" Value="{DynamicResource CascadeTheme.PowerSolutionTreeItemPointerOverBackground}"/>
48 </Style>
49 <Style Selector="UserControl.power TreeView TreeViewItem:selected">
50 <Setter Property="Background" Value="{DynamicResource CascadeTheme.PowerSolutionTreeItemSelectedBackground}"/>
51 <Setter Property="BorderBrush" Value="{DynamicResource CascadeTheme.PowerNeonBorder}"/>
52 <Setter Property="BorderThickness" Value="3,0,0,0"/>
53 </Style>
54 <Style Selector="UserControl.power Image.solutionExplorerTreeIcon">
55 <Setter Property="Width" Value="16"/>
56 <Setter Property="Height" Value="16"/>
57 <Setter Property="Opacity" Value="0.92"/>
58 </Style>
59 <Style Selector="UserControl.compact TreeView TreeViewItem">
60 <Setter Property="Padding" Value="2,2"/>
61 <Setter Property="MinHeight" Value="22"/>
62 </Style>
63 <Style Selector="UserControl.compact:not(.power) TreeView TreeViewItem">
64 <Setter Property="Padding" Value="2,2"/>
65 <Setter Property="MinHeight" Value="22"/>
66 </Style>
67 </UserControl.Styles>
68 <Panel>
69 <Border IsVisible="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyEq}, ConverterParameter=Power}"
70 IsHitTestVisible="False"
71 Background="{DynamicResource CascadeTheme.PowerSolutionIslandFrameBrush}"
72 CornerRadius="14"/>
73 <Border x:Name="SolutionIslandInner"
74 ZIndex="1"
75 Classes.power="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyEq}, ConverterParameter=Power}">
76 <Grid RowDefinitions="Auto,*,4,Auto">
77 <StackPanel Grid.Row="0" Margin="0,4,0,0">
78 <views:PanelChromeHeader Classes.powerSolutionExplorer="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyEq}, ConverterParameter=Power}"
79 Title="Решение · дерево проекта"
80 UppercaseTitle="True"/>
81 <TextBlock Text="{Binding StartupProjectBanner}"
82 FontSize="11"
83 TextWrapping="Wrap"
84 Margin="2,2,0,0"
85 Opacity="0.8"
86 Foreground="{DynamicResource CascadeTheme.SolutionExplorerHeaderForeground}"
87 IsVisible="{Binding HasStartupProject}"/>
88 <StackPanel Orientation="Horizontal" Spacing="6" Margin="2,4,0,0"
89 IsVisible="{Binding ShowLaunchProfilePicker}">
90 <TextBlock Text="Профиль запуска"
91 FontSize="11"
92 VerticalAlignment="Center"
93 Opacity="0.8"
94 Foreground="{DynamicResource CascadeTheme.SolutionExplorerHeaderForeground}"/>
95 <ComboBox MinWidth="140"
96 MaxWidth="280"
97 FontSize="11"
98 ItemsSource="{Binding LaunchProfileIds}"
99 SelectedItem="{Binding SelectedLaunchProfileId, Mode=TwoWay}"/>
100 </StackPanel>
101 <TextBox x:Name="SolutionFilterBox"
102 Watermark="Поиск в дереве (Ctrl+;)"
103 Text="{Binding SolutionExplorerFilterText, Mode=TwoWay}"
104 FontSize="11"
105 Margin="2,4,2,0"
106 Padding="6,4"/>
107 </StackPanel>
108 <TreeView x:Name="SolutionTree"
109 Grid.Row="1"
110 ItemsSource="{Binding SolutionExplorerDisplayRoots}"
111 SelectedItem="{Binding SolutionExplorerSelectedItem, Mode=TwoWay}"
112 Margin="0,4,0,0">
113 <TreeView.ContextMenu>
114 <ContextMenu>
115 <MenuItem Header="_Открыть"
116 Command="{Binding OpenSelectedSolutionItemCommand}"/>
117 <MenuItem Header="Показать в проводнике"
118 Command="{Binding RevealSelectedSolutionItemInExplorerCommand}"/>
119 <MenuItem Header="Копировать _путь"
120 Command="{Binding CopySelectedSolutionItemPathCommand}"/>
121 <Separator/>
122 <MenuItem Header="Следить за активным файлом"
123 ToggleType="CheckBox"
124 IsChecked="{Binding SolutionExplorerTrackActiveItem, Mode=TwoWay}"/>
125 <MenuItem Header="_Компактное дерево"
126 ToggleType="CheckBox"
127 IsChecked="{Binding SolutionExplorerCompactTree, Mode=TwoWay}"/>
128 <Separator/>
129 <MenuItem Header="Сделать стартовым для отладки (F5)"
130 Command="{Binding SetStartupProjectFromSelectionCommand}"/>
131 <MenuItem Header="Сбросить стартовый проект"
132 Command="{Binding ClearStartupProjectCommand}"/>
133 <MenuItem Header="Импорт профилей из launchSettings.json"
134 Command="{Binding ImportLaunchSettingsFromSelectionCommand}"/>
135 </ContextMenu>
136 </TreeView.ContextMenu>
137 <TreeView.ItemTemplate>
138 <TreeDataTemplate DataType="models:SolutionItem"
139 ItemsSource="{Binding Children}">
140 <StackPanel Orientation="Horizontal" Spacing="6">
141 <Image Classes="solutionExplorerTreeIcon" Width="16" Height="16" VerticalAlignment="Center">
142 <Image.Source>
143 <MultiBinding Converter="{StaticResource SolutionItemIconConverter}">
144 <Binding/>
145 <Binding Path="DataContext.UiModeFamily" ElementName="Root"/>
146 </MultiBinding>
147 </Image.Source>
148 </Image>
149 <TextBlock Text="{Binding Title}" VerticalAlignment="Center"/>
150 </StackPanel>
151 </TreeDataTemplate>
152 </TreeView.ItemTemplate>
153 </TreeView>
154 <GridSplitter Grid.Row="2"
155 Height="4"
156 ResizeDirection="Rows"
157 Background="{DynamicResource CascadeTheme.PowerSolutionPanelBorderSubtle}"
158 IsVisible="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyEq}, ConverterParameter=Power}"
159 IsEnabled="{Binding WorkspaceSplittersUnlocked}"/>
160 <Border Grid.Row="3"
161 IsVisible="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyEq}, ConverterParameter=Power}"
162 MaxHeight="200"
163 MinHeight="72"
164 Margin="0,4,0,0"
165 Padding="4"
166 Background="{DynamicResource CascadeTheme.PowerWorkspaceHealthStripBackground}"
167 BorderBrush="{DynamicResource CascadeTheme.PowerSolutionPanelBorderSubtle}"
168 BorderThickness="1"
169 CornerRadius="8">
170 <DockPanel DataContext="{Binding InstrumentationPanel}" x:DataType="feat:InstrumentationPanelViewModel">
171 <views:PanelChromeHeader DockPanel.Dock="Top"
172 Classes="powerSolutionExplorer"
173 Title="Очередь задач · исполнение"
174 UppercaseTitle="True"/>
175 <TextBlock DockPanel.Dock="Top"
176 Text="Очередь пуста — элементы появятся при постановке задач агентом."
177 FontSize="11"
178 TextWrapping="Wrap"
179 IsVisible="{Binding !HasPowerTaskQueueItems}"
180 Foreground="{DynamicResource CascadeTheme.PowerSolutionTreeForeground}"
181 Opacity="0.75"
182 Margin="0,0,0,4"/>
183 <ScrollViewer VerticalScrollBarVisibility="Auto">
184 <ItemsControl ItemsSource="{Binding PowerTaskQueueItems}"
185 IsVisible="{Binding HasPowerTaskQueueItems}">
186 <ItemsControl.ItemTemplate>
187 <DataTemplate DataType="vm:PowerTaskQueueItemViewModel">
188 <Border Padding="4,2" Margin="0,0,0,2" CornerRadius="2"
189 Background="{DynamicResource CascadeTheme.PowerSolutionTaskQueueBubbleBackground}">
190 <TextBlock Text="{Binding DisplayLine}"
191 TextWrapping="Wrap"
192 FontSize="11"
193 Foreground="{DynamicResource CascadeTheme.PowerSolutionTreeForeground}"/>
194 </Border>
195 </DataTemplate>
196 </ItemsControl.ItemTemplate>
197 </ItemsControl>
198 </ScrollViewer>
199 </DockPanel>
200 </Border>
201 </Grid>
202 </Border>
203 </Panel>
204</UserControl>
205
View only · write via MCP/CIDE