Quantcast
Channel: Caliburn.Micro: Xaml Made Easy
Viewing all articles
Browse latest Browse all 1760

New Post: Dynamically add button when loading viewmodel

$
0
0

So I discovered that there is a much simpler way of doing this:

<StackPanel><ItemsControlx:Name="Items"><ItemsControl.ItemTemplate><DataTemplate><ButtonContent="{Binding DisplayName}"cal:Message.Attach="[Action ActivateItem($this)"/></DataTemplate></ItemsControl.ItemTemplate></ItemsControl></StackPanel><ContentControlx:Name="ActiveItem"Grid.Column="1"/>

Is there a way to dynamically bind to a property on the ViewModel to determine if the button should be active?

I tried IsEnabled="{Binding MyBoolProperty}", but it doesn't seem to work?

Any suggestions?


Viewing all articles
Browse latest Browse all 1760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>