mirror of
https://github.com/ShrlAlgo/AddinManager.git
synced 2026-03-07 16:38:56 +00:00
添加项目文件。
This commit is contained in:
414
AddInManager/Wpf/MainWindow.xaml
Normal file
414
AddInManager/Wpf/MainWindow.xaml
Normal file
@@ -0,0 +1,414 @@
|
||||
<Window
|
||||
x:Class="AddInManager.Wpf.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
Title="插件管理器"
|
||||
Width="580"
|
||||
Height="520"
|
||||
Background="{DynamicResource BackgroundBrush}"
|
||||
ResizeMode="CanResize"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Styles/ModernStyles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Tab Control -->
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0,0,0,5"
|
||||
Style="{StaticResource ContentContainer}">
|
||||
<TabControl x:Name="externalToolsTabControl" SelectionChanged="ExternalToolsTabControl_SelectionChanged">
|
||||
<TabItem x:Name="commandsTabPage" Header="已加载外部命令">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 搜索栏和工具栏 -->
|
||||
<Grid Grid.Row="0" Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox
|
||||
x:Name="searchTextBox"
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SearchTextBox}"
|
||||
Tag="搜索命令..."
|
||||
TextChanged="SearchTextBox_TextChanged" />
|
||||
<!-- 工具栏 -->
|
||||
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
|
||||
|
||||
<UniformGrid Rows="1">
|
||||
<Button
|
||||
x:Name="selectAllButton"
|
||||
Margin="2"
|
||||
Click="SelectAllButton_Click"
|
||||
Style="{StaticResource ToolbarButton}"
|
||||
ToolTip="选择所有命令项">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Text="" />
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
x:Name="selectNoneButton"
|
||||
Click="SelectNoneButton_Click"
|
||||
Style="{StaticResource ToolbarButton}"
|
||||
ToolTip="取消所有选择">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UniformGrid>
|
||||
<Rectangle
|
||||
Width="1"
|
||||
Height="16"
|
||||
Margin="4,0"
|
||||
Fill="{StaticResource BorderBrush}" />
|
||||
<UniformGrid Rows="1">
|
||||
<Button
|
||||
x:Name="expandAllButton"
|
||||
Margin="2"
|
||||
Click="ExpandAllButton_Click"
|
||||
Style="{StaticResource ToolbarButton}"
|
||||
ToolTip="展开所有节点">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Text="" />
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
x:Name="collapseAllButton"
|
||||
Click="CollapseAllButton_Click"
|
||||
Style="{StaticResource ToolbarButton}"
|
||||
ToolTip="折叠所有节点">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<TreeView
|
||||
x:Name="commandsTreeView"
|
||||
Grid.Row="1"
|
||||
Margin="8,4,8,8"
|
||||
d:ItemsSource="{d:SampleData ItemCount=5}"
|
||||
BorderThickness="0"
|
||||
LostFocus="CommandsTreeView_LostFocus"
|
||||
MouseDoubleClick="CommandsTreeView_MouseDoubleClick"
|
||||
PreviewMouseRightButtonDown="CommandsTreeView_PreviewMouseRightButtonDown"
|
||||
SelectedItemChanged="CommandsTreeView_SelectedItemChanged">
|
||||
<!-- 为 TreeViewItem 定义右键菜单 (已更新图标) -->
|
||||
<TreeView.ContextMenu>
|
||||
<ContextMenu x:Name="commandsTreeViewContextMenu">
|
||||
<MenuItem
|
||||
x:Name="ContextMenuRun"
|
||||
Click="ContextMenuRun_Click"
|
||||
Header="运行">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="14"
|
||||
Text="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
|
||||
<Separator />
|
||||
|
||||
<MenuItem
|
||||
x:Name="ContextMenuLoad"
|
||||
Click="ContextMenuLoad_Click"
|
||||
Header="加载新插件...">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="14"
|
||||
Text="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
x:Name="ContextMenuRemove"
|
||||
Click="ContextMenuRemove_Click"
|
||||
Header="移除">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="14"
|
||||
Text="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
x:Name="ContextMenuReload"
|
||||
Click="ContextMenuReload_Click"
|
||||
Header="重新加载">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="14"
|
||||
Text="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
|
||||
<Separator />
|
||||
|
||||
<MenuItem
|
||||
x:Name="ContextMenuOpenInExplorer"
|
||||
Click="ContextMenuOpenInExplorer_Click"
|
||||
Header="在资源管理器中显示">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="14"
|
||||
Text="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
x:Name="ContextMenuAssemblyInfo"
|
||||
Click="ContextMenuAssemblyInfo_Click"
|
||||
Header="查看程序集信息">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="14"
|
||||
Text="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</TreeView.ContextMenu>
|
||||
</TreeView>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem x:Name="applicationsTabPage" Header="已加载外部应用">
|
||||
<Grid Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<UniformGrid Rows="1">
|
||||
<Button
|
||||
x:Name="appSelectAllButton"
|
||||
Margin="2"
|
||||
Click="AppSelectAllButton_Click"
|
||||
Style="{StaticResource ToolbarButton}"
|
||||
ToolTip="选择所有命令项">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Text="" />
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
x:Name="appSelectNoneButton"
|
||||
Click="AppSelectNoneButton_Click"
|
||||
Style="{StaticResource ToolbarButton}"
|
||||
ToolTip="取消所有选择">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UniformGrid>
|
||||
<Rectangle
|
||||
Width="1"
|
||||
Height="16"
|
||||
Margin="4,0"
|
||||
Fill="{StaticResource BorderBrush}" />
|
||||
<!-- 应用程序工具栏 -->
|
||||
<UniformGrid HorizontalAlignment="Left" Rows="1">
|
||||
<Button
|
||||
x:Name="appExpandAllButton"
|
||||
Margin="2"
|
||||
Click="AppExpandAllButton_Click"
|
||||
Style="{StaticResource ToolbarButton}"
|
||||
ToolTip="展开所有应用程序节点">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Text="" />
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
x:Name="appCollapseAllButton"
|
||||
Click="AppCollapseAllButton_Click"
|
||||
Style="{StaticResource ToolbarButton}"
|
||||
ToolTip="折叠所有应用程序节点">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- TreeView -->
|
||||
<TreeView
|
||||
x:Name="applicationsTreeView"
|
||||
Grid.Row="1"
|
||||
Margin="8,4,8,8"
|
||||
BorderThickness="0"
|
||||
LostFocus="ApplicationsTreeView_LostFocus"
|
||||
MouseUp="ApplicationsTreeView_MouseUp"
|
||||
SelectedItemChanged="ApplicationsTreeView_SelectedItemChanged" />
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Border>
|
||||
|
||||
<!-- 输入区域 -->
|
||||
<Grid Grid.Row="1" Grid.Column="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Name -->
|
||||
<StackPanel Grid.Row="0">
|
||||
<TextBlock Text="名称:" />
|
||||
<TextBox x:Name="nametextBox" LostFocus="NameTextBox_LostFocus" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Description -->
|
||||
<StackPanel Grid.Row="1">
|
||||
<TextBlock Text="描述:" />
|
||||
<TextBox
|
||||
x:Name="descriptionTextBox"
|
||||
AcceptsReturn="True"
|
||||
LostFocus="DescriptionTextBox_LostFocus"
|
||||
TextWrapping="Wrap"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Notes -->
|
||||
<StackPanel Grid.Row="2">
|
||||
<TextBlock Text="备注:" />
|
||||
<TextBox x:Name="notesTextBox" IsReadOnly="True" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Right Side Buttons -->
|
||||
<UniformGrid
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Margin="5"
|
||||
Columns="1">
|
||||
<Button
|
||||
x:Name="runButton"
|
||||
Margin="5"
|
||||
Click="RunButton_Click"
|
||||
Style="{StaticResource ActionButton}"
|
||||
Tag="Primary">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" />
|
||||
<TextBlock Margin="5,0,0,0" Text="运行" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="loadButton"
|
||||
Margin="5"
|
||||
Click="LoadButton_Click"
|
||||
Style="{StaticResource ActionButton}"
|
||||
Tag="Primary">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" />
|
||||
<TextBlock Margin="5,0,0,0" Text="加载" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="removeButton"
|
||||
Margin="5"
|
||||
Click="RemoveButton_Click"
|
||||
LostFocus="RemoveButton_LostFocus"
|
||||
Style="{StaticResource ActionButton}"
|
||||
Tag="Danger">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" />
|
||||
<TextBlock Margin="5,0,0,0" Text="移除" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="saveSplitButton"
|
||||
Margin="5"
|
||||
Click="SaveSplitButton_Click">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" />
|
||||
<TextBlock Margin="5,0,0,0" Text="保存" />
|
||||
</StackPanel>
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu x:Name="saveContextMenu">
|
||||
<MenuItem Click="SaveToAddinMenuItem_Click" Header="保存选中项到 Addins 文件夹">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="14"
|
||||
Text="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Click="SaveLocalMenuItem_Click" Header="保存选中项到本地 .addin 文件">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="14"
|
||||
Text="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
</Button>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user