wsick / Fayde

Inspired by Silverlight; XAML engine using Javascript and rendering to the HTML5 Canvas.
MIT License
189 stars 27 forks source link

Checkbox not working in DataTemplate #167

Closed deepaksm1 closed 8 years ago

deepaksm1 commented 9 years ago

We have created checkbox list in ItemsControl. First time check box click not working. It is not getting checked. After second click it works.

 <ItemsControl ItemsSource="{Binding Path=Services}" >
            <ItemsControl.ItemTemplate>
              <DataTemplate>
                <StackPanel Orientation="Horizontal">
                  <CheckBox IsChecked="{Binding Path=IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                            Checked="{EventBinding Command={Binding DataContext.Checked, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ScrollViewer}}, CommandParameter={Binding}}}"
                            Unchecked="{EventBinding Command={Binding DataContext.Unchecked, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ScrollViewer}}, CommandParameter={Binding}}}" />
                  <TextBlock  Text="{Binding Path=Description}" Foreground ="White" FontSize="16" />
                </StackPanel>
              </DataTemplate>
            </ItemsControl.ItemTemplate>
          </ItemsControl>