Forum Xamarin.Forms

BindableProperty on nested ContentView

JohnErnestJohnErnest USMember ✭✭

Is there a way to make the Xamarin Forms previewer on VS for Mac update a BindableProperty at design time without static "design time data", for a visual property element?

In this specific case I have a subclass of a ContentView with a BindableProperty like say "ImageVerticalPlacement", that I want to nest within another ContentView for layout purposes.

However, even setting it like this in the nested ContentView:

<Label Text="{Binding Source={x:Reference auraMainButton}, Path=ImageVerticalPlacement, Mode=TwoWay}" TextColor="Black" />

where auraMainButton is the nested ContentView doesn't change from the default value in design mode when I do something like:

    <controls:AuraButton ImageVerticalPlacement="Below" ImageHorizontalPlacement="Right">

in the main ContentView.

It makes sense to use "design time data" when we're talking about data in a model or a vm, but we're talking about visual properties here rather than model data. This is for making reusable composite UI controls that in some cases may be a ContentView with possibly several nested ContentViews that aren't Controls.

Any ideas?

Sign In or Register to comment.