Skip to content

DesignHost does not expose properties to vs designer since vs2013 #5

@micdenny

Description

@micdenny

I don't have so much information regard this, I just know that exposing property through Radical DesignTimeHost<T> does not work anymore, or better, the property can used in binding, and the designer render it just fine, but the vs designer tools (like property selector) shows only CultureUI property and all the other viewmodel properties are not shown.

image

using this ViewModel:

    public class MainViewModel : AbstractViewModel
    {
        public int UserId
        {
            get { return this.GetPropertyValue(() => this.UserId); }
            set { this.SetPropertyValue(() => this.UserId, value); }
        }

        public string FirstName
        {
            get { return this.GetPropertyValue(() => this.FirstName); }
            set { this.SetPropertyValue(() => this.FirstName, value); }
        }

        public string LastName
        {
            get { return this.GetPropertyValue(() => this.LastName); }
            set { this.SetPropertyValue(() => this.LastName, value); }
        }
    }

and this DesignViewModel:

    public class DesignMainViewModel : DesignTimeHost<MainViewModel>
    {
        public DesignMainViewModel()
        {
            Expose(vm => vm.UserId)
                .WithStaticValue(10);

            Expose(vm => vm.FirstName)
                .WithStaticValue("Michael");

            Expose(vm => vm.LastName)
                .WithStaticValue("Denny");
        }
    }

if you simply add the binding, the render is done properly:

image

also the binding expression intellisense in xaml does not work:

image

[intellisense workaround] if you have resharper you can hit CTRL+space as it does another deep search and it finds the property:

image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions