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>

相关推荐
玖玥拾5 小时前
Cocos学习笔记:滚动视图、关卡系统与本地存储
游戏引擎·cocos2d
LCG元12 小时前
现代Web应用高可用架构设计与性能调优实战
前端·wpf
元气少女小圆丶12 小时前
SenseGlove Nova 2+Unity开发笔记2
笔记·unity·游戏引擎
许彰午14 小时前
状态模式实战——Row对象的状态机
java·ui·状态模式
zhbi9814 小时前
LVGL8.3标签Label高级应用
ui·lvgl
Oiiouui15 小时前
Godot(4.x): 游戏管理器: Godot 内注入数据处理与总接口实现
游戏·游戏引擎·godot
像风一样的男人@17 小时前
warning: could not find UI helper ‘git-credential-manager-ui‘
git·ui
小二·17 小时前
向量数据库深度对比:PGVector vs Qdrant vs Milvus vs Chroma(附性能测试数据)
数据库·wpf·milvus
魔士于安17 小时前
unity volumefog带各种demo第一人称 wsad 穿墙控制
游戏·unity·游戏引擎·贴图·模型
ZC跨境爬虫18 小时前
跟着 MDN 学CSS day_34:(CSS 布局全面解析)
前端·css·ui·html·tensorflow