This is a migrated thread and some comments may be shown as answers.

Problems with RadFluidControl

1 Answer 46 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Javier
Top achievements
Rank 1
Javier asked on 15 Dec 2014, 08:32 PM
I'm having a problem where RadFluidControl doesn't change it's state. Although the ContentState property is set when when the view is initially loaded, it doesn't seem to change when I min/max/restore tiles and remains in the NormalContent state.

Code is as follows:
<telerik:RadTileView x:Name="rtvItems" telerik:StyleManager.Theme="Office_Blue" Background="White" Grid.Row="2" MaxColumns="3"   ItemsSource="{Binding CaseItems, Mode=TwoWay}"  PreservePositionWhenMaximized="True" RowHeight="150" MinimizedRowHeight="150"   TileStateChangeTrigger="DoubleClick" ItemTemplate="{StaticResource CaseItemTemplate}" ContentTemplate="{StaticResource CaseContentTemplate}" />
 
<telerik:ContainerBindingCollection x:Key="ContainerBindingCollection">
<telerik:ContainerBinding Binding="{Binding ContentState, Mode=TwoWay, Converter={StaticResource  TileStateConverter}}" PropertyName="TileState" />
            </telerik:ContainerBindingCollection>
 
            <DataTemplate x:Key="CaseItemTemplate" telerik:ContainerBinding.ContainerBindings="{StaticResource ContainerBindingCollection}">
                <StackPanel Orientation="Horizontal">
                    <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" />
                    <TextBox Text="{Binding ItemDisplayName}" IsReadOnly="True" />
                </StackPanel>
            </DataTemplate>
 
            <DataTemplate x:Key="CaseContentTemplate">
                <telerik:RadFluidContentControl ContentChangeMode="Manual" State="{Binding ContentState, Converter={StaticResource FluidContentStateConverter}}">
                    <telerik:RadFluidContentControl.SmallContent>
                        <Grid Width="200" Height="200">                           
                            <TextBlock>This is small content.</TextBlock>
                        </Grid>
                    </telerik:RadFluidContentControl.SmallContent>
                    <telerik:RadFluidContentControl.Content>
                        <Grid Width="400" Height="400">                           
                            <TextBlock>This is normal content.</TextBlock>
                        </Grid>
                    </telerik:RadFluidContentControl.Content>
                    <telerik:RadFluidContentControl.LargeContent>
                        <Grid Width="600" Height="600">
                            <TextBlock>This is large content.</TextBlock>
                        </Grid>
                    </telerik:RadFluidContentControl.LargeContent>
                </telerik:RadFluidContentControl>
 
            </DataTemplate>

The FluidContentStateConverter and TileStateConverter are based on your example here.

And here's the class that I use:
public abstract class AMediaItem : INotifyPropertyChanged
    {
        [DataMember]
        public virtual string ID { get; set; }
        [DataMember]
        public bool IsSelected { get; set; }
        [DataMember]
        public int AgencyID { get; set; }
        [DataMember]
        public string FileName { get; set; }
        [DataMember]
        public string FriendlyName { get; set; }           
...
...
        private ContentState _ContentState;
        /// <summary>
        ///     Gets or sets the name.
        /// </summary>
        ///
        [DataMember]
        public ContentState ContentState
        {
            get
            {
                return _ContentState;
            }
            set
            {
                if (_ContentState != value)
                {
                    _ContentState = value;
                    NotifyPropertyChanged("ContentState");
                }
            }
        
 
        private void NotifyPropertyChanged(string property)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(property));
        }
 
    }
 
    public enum ContentState
    {
        SmallContent = 1,
        NormalContent = 0,
        LargeContent = 2
    }


So what gives?  I feel like I've done everything that was based off the above link.  

1 Answer, 1 is accepted

Sort by
0
Javier
Top achievements
Rank 1
answered on 16 Dec 2014, 06:57 AM
Fixed my problem.  Turns out that I had another ContentState enum elsewhere in my code.  Removed the extra enum and corrected my references, worked.  Big thanks to me!
Tags
TileView
Asked by
Javier
Top achievements
Rank 1
Answers by
Javier
Top achievements
Rank 1
Share this question
or