1

I am currently working on a WPF project with the Telerik FW.

During the runtime I am getting the following warning:

System.Windows.Freezable Warning: 1 : CanFreeze is returning false because a DependencyProperty on the Freezable has a value that is an expression; Freezable='System.Windows.Media.TranslateTransform'; Freezable.HashCode='36319496'; Freezable.Type='System.Windows.Media.TranslateTransform'; DP='X'; DpOwnerType='System.Windows.Media.TranslateTransform'

This is my xaml code

<Style x:Key="PieSliceStyle" TargetType="Path">
            <Setter Property="Fill" Value="{Binding DataItem.Color}" />
        </Style>

<telerik:PieSeries ItemsSource="{Binding Source}" DefaultSliceStyle="{StaticResource PieSliceStyle}">
                    <telerik:PieSeries.ValueBinding>
                        <telerik:PropertyNameDataPointBinding PropertyName="Value" />
                    </telerik:PieSeries.ValueBinding>
                    <telerik:PieSeries.LabelDefinitions>
                        <telerik:ChartSeriesLabelDefinition Margin="-10">
                            <telerik:ChartSeriesLabelDefinition.Binding>
                                <telerik:PropertyNameDataPointBinding PropertyName="Label" />
                            </telerik:ChartSeriesLabelDefinition.Binding>
                        </telerik:ChartSeriesLabelDefinition>
                    </telerik:PieSeries.LabelDefinitions>
                </telerik:PieSeries>

And this is some part of my ViewModel

 private readonly SolidColorBrush PieColorEnableSlice = new SolidColorBrush(Colors.LightGray);
        private readonly SolidColorBrush PieColorDisabledSlice = new SolidColorBrush(Colors.Red);

 public AsyncObservableCollection<MSShareClassModel> List
        {
            get
            {
                return this._list;
            }

            set
            {
                if (this.SetProperty(ref this._list, value, "List"))
                {
                    this.Source = new AsyncObservableCollection<PieChartModel>
                                                          {
                                                              new PieChartModel
                                                                  {
                                                                      Label = "Active",
                                                                      Value = this._list.Count(x => x.Status == "1"),
                                                                      Color = this.PieColorEnableSlice
                                                                  },
                                                              new PieChartModel
                                                                  {
                                                                      Label = "Disable",
                                                                      Value = this._list.Count(x => x.Status == "0"),
                                                                      Color = this.PieColorDisabledSlice
                                                                  },
                                                          };
                }
            }
        }

I think one solution would be to create the corlor directly from the xaml source. But I want to keep this binding to be able to change the color programatically.

Any idea on this warning?

pix
  • 1,264
  • 19
  • 32
  • Peharps use a DynamicResource for DefaultSliceStyle: i already read that it helps to fix that warning... – Benoît May 30 '16 at 13:51
  • This does not change anything :/ DefaultSliceStyle="{DynamicResource PieSliceStyle}"> – pix May 31 '16 at 10:01

1 Answers1

0

Ok After more investigation, this is not comming from the pieSeries.. This is fired by the RadGridView....

I removed all the xaml components one by one from the xaml. The last one alive was the grid and I keeped having that warning. I removed the grid and enabled all the others components, and the warning was gone until I uncomment the grid in the xaml. Nothing fancy, just the simple RadGridView declaration. No DataSource or Column definition, just a simple empty grid.

This issue seems to have been declared to telerik dev team since 2010 from many components. (Treeviews, grid etc...)

And after some reading, Telerik will not fix this kind of issue... (we can vote for it on http://feedback.telerik.com/ :) )

I will not make this as an answer, I still have the warning =/

pix
  • 1,264
  • 19
  • 32