wpf游戏引擎主界面实现3

1.ProjectLayout.xaml

<UserControl x:Class="PrimalEditor.Editors.ProjectLayoutView"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

xmlns:local="clr-namespace:PrimalEditor.Editors"

xmlns:proj="clr-namespace:PrimalEditor.GameProject"

mc:Ignorable="d"

d:DesignHeight="450" d:DesignWidth="800">

<Grid>

<Grid.RowDefinitions>

<RowDefinition Height="32"/>

<RowDefinition/>

</Grid.RowDefinitions>

<Button Content="Add Scene" Width="96" VerticalAlignment="Center" Focusable="False" Grid.Row="0" HorizontalAlignment="Left" Margin="20,0,0,0"

Command="{Binding AddSceneCommand}" />

<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">

<ItemsControl ItemsSource="{Binding Scenes}">

<ItemsControl.ItemsPanel>

<ItemsPanelTemplate>

<StackPanel/>

</ItemsPanelTemplate>

</ItemsControl.ItemsPanel>

<ItemsControl.ItemTemplate>

<DataTemplate>

<Expander IsExpanded="{Binding IsActive,Mode=OneWay}">

<Expander.Header>

<Grid>

<StackPanel Orientation="Horizontal">

<TextBlock Text="{Binding Name}"/>

<Button Content="Remove"

Command="{Binding DataContext.RemoveSceneCommand,RelativeSource={RelativeSource AncestorType=UserControl}}"

CommandParameter="{Binding}" Margin="20,0" Focusable="False"

/>

<Button Content="+" IsEnabled="True"

Click="OnAddGameEntity_Button_Click"

/>

</StackPanel>

</Grid>

</Expander.Header>

<ListBox ItemsSource="{Binding GameEntities}" IsEnabled="True" SelectionMode="Extended"

SelectionChanged="OnGameEntities_ListBox_SelectionChanged">

<ListBox.ItemTemplate>

<DataTemplate>

<StackPanel Orientation="Horizontal">

<TextBlock Text="{Binding Name}"/>

<Button Content="Remove"

Command="{Binding ParentScene.RemoveGameEntityCommand}"

CommandParameter="{Binding}"/>

</StackPanel>

</DataTemplate>

</ListBox.ItemTemplate>

</ListBox>

</Expander>

</DataTemplate>

</ItemsControl.ItemTemplate>

</ItemsControl>

</ScrollViewer>

</Grid>

</UserControl>

相关推荐
覆东流1 天前
Photoshop通道的应用
ui·photoshop
我命由我123451 天前
Photoshop - Photoshop 工具栏(24)磁性套索工具
学习·ui·职场和发展·求职招聘·职场发展·课程设计·美工
Larry_Yanan1 天前
QML学习笔记(五十二)QML与C++交互:数据转换——时间和日期
开发语言·c++·笔记·qt·学习·ui·交互
极客柒1 天前
Unity 协程GC优化记录
java·unity·游戏引擎
夏之繁花1 天前
Adobe Photoshop 2026 v27.0.0
ui·adobe·photoshop
黄思搏1 天前
Unity SpriteRenderer 进度条 Shader 实现
unity·游戏引擎
我命由我123451 天前
Photoshop - Photoshop 工具栏(20)混合器画笔工具
经验分享·笔记·学习·ui·职场和发展·职场发展·photoshop
LateFrames1 天前
使用 Winform / WPF / WinUI3 / Electron 实现异型透明窗口
javascript·electron·wpf·winform·winui3
ifeng09181 天前
HarmonyOS实战项目:AI健康助手(影像识别与健康分析)
人工智能·华为·wpf·harmonyos
Aevget1 天前
界面控件Telerik UI for WPF 2025 Q3亮点 - 集成AI编码助手
人工智能·ui·wpf·界面控件·ui开发·telerik