can thriple backcontent binding?

Mar 29, 2011 at 8:47 AM

Recently on one of my projects in the Thriple, but I found that if BackContent value is binding of words, just doesn't work

the xaml:

<ItemsControl ItemsSource="{Binding ImagePathList}" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <thriple:ContentControl3D x:Name="cntCtrl3D" BackContent="{Binding ImagePackString, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
                                                        BackContentTemplate="{StaticResource ImageButtonTemplate}" Background="#88FFFFFF" BorderBrush="DarkGray"
                                                        BorderThickness="0" Content="{Binding ImagePackString, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
                                                        ContentTemplate="{StaticResource ImageButtonTemplate}" MaxWidth="300" MaxHeight="300" Style="{StaticResource BackFlipStyle}" />
                    </Grid>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
        </ItemsControl>

 

public class ImagePath : INotifyPropertyChanged
    {
        private string imagePackString;
        public string ImagePackString
        {
            get { return imagePackString; }
            set
            {
                if (value != this.imagePackString)
                {
                    imagePackString = value;
                    this.NotifyProertyChanged("ImagePackString");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyProertyChanged(string property)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(property));
            }
        }
    }