Problems with RadFluidControl

2 posts, 0 answers
  1. Javier
    Javier avatar
    7 posts
    Member since:
    Jun 2014

    Posted 15 Dec 2014 Link to this post

    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.  
  2. Javier
    Javier avatar
    7 posts
    Member since:
    Jun 2014

    Posted 16 Dec 2014 in reply to Javier Link to this post

    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!
  3. DevCraft banner
Back to Top