WIn_RustTools/RustTools/Editor/EditorWin.xaml

103 lines
3.9 KiB
XML

<?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"
xmlns:controlpages="using:RustTools.Editor"
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">
<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">
<TreeViewItem AutomationProperties.Name="{Binding Name}">
<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}" />
<TabViewItem x:Key="FileTab">
<TextBox
x:Name="MyTextBox"
Height="200"
AcceptsReturn="True"
TextWrapping="Wrap" />
</TabViewItem>
</Page.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<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
Grid.Row="2"
Grid.Column="0"
Width="300"
Margin="0,9,0,6"
Padding="0,0,16,0"
HorizontalScrollBarVisibility="Visible"
HorizontalScrollMode="Auto"
IsHorizontalRailEnabled="True"
IsHorizontalScrollChainingEnabled="True">
<TreeView
Name="treeView"
Grid.Row="2"
Grid.Column="0"
ItemInvoked="TreeView_ItemInvoked"
ItemTemplateSelector="{StaticResource ExplorerItemTemplateSelector}"
ItemsSource="{x:Bind DataSource}"
KeyDown="treeView_KeyDown"
KeyUp="treeView_KeyUp"
SelectionMode="Single" />
</ScrollViewer>
<Grid Grid.Row="1" Grid.Column="1" />
</Grid>
</Page>
</windowex:WindowEx>