Exemple #1
0
        public ModelBindingAssetControl(ModelBindingAsset asset)
        {
            InitializeComponent();

            Handler = new ModelBindingAssetControlHandler(asset, this);

            Data.DataContext = asset;
        }
        public void Initialize(ModelBindingAsset asset)
        {
            ModelBindingName.Text = asset.AssetName;

            bool isPathValid = asset.EditorPath.IsPathValid();

            FileName.Text = isPathValid ? Path.GetFileName(asset.EditorPath) : asset.EditorPath;

            if (isPathValid)
            {
                PreviewTextBox.Text = File.ReadAllText(asset.EditorPath);
            }
        }