WIn_RustTools/RustTools/Editor/EditorWin.xaml

117 lines
4.4 KiB
Plaintext
Raw Normal View History

<?xml version="1.0" encoding="utf-8" ?>
<windowex:WindowEx
x:Class="RustTools.Editor.EditorWin"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2024-08-09 07:05:40 +00:00
xmlns:controlpages="using:RustTools.Editor"
2024-08-13 10:47:12 +00:00
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:RustTools"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:windowex="using:WinUIEx"
MinWidth="500"
MinHeight="500"
mc:Ignorable="d">
2024-08-09 07:05:40 +00:00
<Page Name="page">
<Page.Resources>
<DataTemplate x:Key="FolderTemplate">
<TreeViewItem
AutomationProperties.Name="{Binding Name}"
IsExpanded="False"
ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal">
<FontIcon Glyph="&#xE8B7;" />
<TextBlock Margin="0,0,10,0" />
<TextBlock Text="{Binding Name}" />
</StackPanel>
</TreeViewItem>
</DataTemplate>
<DataTemplate x:Key="FileTemplate">
2024-08-13 11:30:40 +00:00
<TreeViewItem AutomationProperties.Name="{Binding Name}" IsExpanded="False">
2024-08-09 07:05:40 +00:00
<StackPanel Orientation="Horizontal">
<FontIcon Glyph="&#xE8A5;" />
<TextBlock Margin="0,0,10,0" />
<TextBlock Text="{Binding Name}" />
</StackPanel>
</TreeViewItem>
</DataTemplate>
<controlpages:ExplorerItemTemplateSelector
x:Key="ExplorerItemTemplateSelector"
FileTemplate="{StaticResource FileTemplate}"
FolderTemplate="{StaticResource FolderTemplate}" />
</Page.Resources>
<Grid>
<Grid.ColumnDefinitions>
2024-08-13 10:47:12 +00:00
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
2024-08-09 07:05:40 +00:00
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
2024-08-09 07:05:40 +00:00
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid
Grid.Row="0"
Padding="9"
Visibility="Visible">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
Name="TitleText"
Grid.Column="0"
Margin="16,0,0,0" />
</Grid>
<ScrollViewer
2024-08-13 10:47:12 +00:00
x:Name="scrollview"
2024-08-09 07:05:40 +00:00
Grid.Row="2"
Grid.Column="0"
Width="300"
Margin="0,9,0,6"
Padding="0,0,16,0"
2024-08-13 10:47:12 +00:00
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
2024-08-09 07:05:40 +00:00
2024-08-13 10:47:12 +00:00
<controlpages:EditorTreeView
2024-08-09 07:05:40 +00:00
Name="treeView"
2024-08-13 10:47:12 +00:00
DoubleTapped="treeView_DoubleTapped"
2024-08-09 07:05:40 +00:00
ItemInvoked="TreeView_ItemInvoked"
ItemTemplateSelector="{StaticResource ExplorerItemTemplateSelector}"
ItemsSource="{x:Bind DataSource}"
2024-08-13 10:47:12 +00:00
ScrollViewer.IsVerticalRailEnabled="False"
2024-08-09 07:05:40 +00:00
SelectionMode="Single" />
</ScrollViewer>
2024-08-13 10:47:12 +00:00
<controls:PropertySizer
2024-08-11 11:16:42 +00:00
Grid.Row="1"
Grid.Column="1"
2024-08-13 10:47:12 +00:00
Binding="{x:Bind scrollview.Width, Mode=TwoWay}"
Maximum="350"
Minimum="200"
Visibility="Visible" />
<Grid
x:Name="gridedit"
Grid.Row="1"
Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TabView
x:Name="tabview"
Grid.Row="0"
Height="auto"
IsAddTabButtonVisible="False"
TabCloseRequested="TabView_TabCloseRequested"
TabItemsSource="{x:Bind TabViewList}" />
2024-08-11 11:16:42 +00:00
2024-08-13 10:47:12 +00:00
</Grid>
</Grid>
2024-08-09 07:05:40 +00:00
</Page>
</windowex:WindowEx>