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>

相关推荐
心前阳光17 小时前
Unity之XR Interaction Toolkit | IPointerDownHandler问题
unity·游戏引擎·xr
李高钢21 小时前
【WPF】从 Avalon 到 .NET 10:WPF 平台演进史与特性全览
.net·wpf
山川志~1 天前
Vue + Element UI 实战:如何实现表格时间、金额字段排序
vue.js·ui·elementui
Oll Correct1 天前
Adobe illustrator 案例六:手枪图标绘制
笔记·ui·adobe·illustrator
李高钢2 天前
WPF MVVM Light 入门:从零到Hello World
c#·wpf
李高钢2 天前
WPF MVVM Light(三):RelayCommand 命令与 Messenger 消息
前端·c#·wpf
l1m0_2 天前
React+Tailwind+AI 实战:连锁餐饮管理后台从零到一开发复盘
前端·react.js·ui·ai·ai设计
帅_shuai_2 天前
unity 静态字段内存查找工具
unity·游戏引擎
ryanuo72 天前
Shadcn/ui × Qt 6/QML:一次从 Web UI 到桌面 UI 的组件化实践
c++·qt·ui·shadcn
郝学胜-神的一滴2 天前
[简化版 GAMES 104] 现代游戏引擎 06:从Tick时序到邮局模型,拆解确定性世界的底层密码
开发语言·c++·游戏引擎·图形渲染·软件开发·opengl