wpf游戏引擎主界面开发1

1.ComponentView.xaml

             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"
             mc:Ignorable="d" x:Name="componentView" MinWidth="300" Margin="0,0,0,1"
             d:DesignHeight="450" d:DesignWidth="800">

   

       

   


   

       

           

       

       

           


       


       


   



2.ComponentView.xaml.cs

using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;

namespace PrimalEditor.Editors
{


    [ContentProperty("ComponentContent")]

    ///


    /// ComponentView.xaml 的交互逻辑
    ///

    public partial class ComponentView : UserControl
    {


        public string Header
        {

            get { return (string)GetValue(HeaderProperty); }
            set { SetValue(HeaderProperty, value); }


        }

        public static readonly DependencyProperty HeaderProperty =
            DependencyProperty.Register(nameof(Header), typeof(string), typeof(ComponentView));

        public FrameworkElement ComponentContent
        {

            get { return (FrameworkElement)GetValue(ComponentContentProperty); }
            set { SetValue(ComponentContentProperty, value); }


        }

        public static readonly DependencyProperty ComponentContentProperty =
            DependencyProperty.Register(nameof(ComponentContent), typeof(FrameworkElement), typeof(ComponentView));

        public ComponentView()
        {
            InitializeComponent();
        }
    }
}
 

你可能感兴趣的:(wpf,游戏引擎,ui)