Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
370
Update color on column
posted

Hi,

I have a xamdatachart with  a columnseries. I set the color on my columns using the AssignCategoryStyle event in a behavior like this:

https://ko.infragistics.com/community/forums/f/ultimate-ui-for-wpf/122420/xamdatachart-columnseries-set-color-on-individual-column/539090

Now I want the color of the column to be updated when the color on my item is updated. The brush on my item notifies when it is changed and I have created a subscription for this that gets called:

 private void AssociatedObject_AssigningCategoryStyle(object sender, AssigningCategoryStyleEventArgs args)
{
if (args.GetItems(args.StartIndex, args.EndIndex)[0] is MyDataItem currentColumn)
{
this.brushSubscription = currentColumn.AsObservable(x => x.Brush)
.Subscribe(_ =>
{
args.Fill = currentColumn.Brush;
});
}

}

but the color on the column is not updated unless I resize my application window. How can I get the new color to show on my column?

Regards,

Hilma

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Hilma,

    I have been investigating into the behavior you are looking to achieve in this case, and in order to notify the series that you are changing the styling of that something has changed, you will need to call the NotifyVisualPropertiesChanged() method on that series. This will cause the AssigningCategoryStyle event to fire again for that series.

    Please let me know if you have any other questions or concerns on this matter.

Children
No Data