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>

相关推荐
Yasin Chen2 天前
Unity UI坐标说明
ui·unity
应用市场2 天前
无人机姿态控制系统详解与实现
游戏引擎·cocos2d
陈言必行3 天前
Unity 性能优化 之 编辑器创建资源优化( 工作流 | 场景 | 预制体)
unity·编辑器·游戏引擎
1uther3 天前
Unity核心概念⑨:Screen
开发语言·游戏·unity·c#·游戏引擎
玉面小君3 天前
从 WPF 到 Avalonia 的迁移系列实战篇6:Trigger、MultiTrigger、DataTrigger 的迁移
wpf·avalonia
死也不注释3 天前
【Unity UGUI 交互组件——Slider(7)】
unity·游戏引擎·交互
眠りたいです3 天前
基于脚手架微服务的视频点播系统-数据管理与网络通信部分的预备工作
c++·qt·ui·微服务·云原生·架构·媒体
挂科是不可能出现的3 天前
unity导入blender动画
unity·游戏引擎·blender
派葛穆3 天前
Unity-按钮实现场景跳转
java·unity·游戏引擎
招风的黑耳4 天前
Java生态圈核心组件深度解析:Spring技术栈与分布式系统实战
java·spring·wpf