We are preparing our bar controls to switching to optimized templates to gain maximum performance (GridControl and PropertyGridControl already use these templates in Optimized Mode). In this mode, bar items will not have a default visual tree in further major updates, so we changed the type of BarItemLinkControl properties to IBarItemLinkControl. While this modification mainly affects the internal implementation, some public properties (such as BarItemLinkBase.LinkControl) have been affected as well.
IBarItemLinkControl duplicates a public API of the standard FrameworkElement class to minimize required changes. There are two scenarios where manual modification is required, though.
- You have a variable of the BarItemLinkControl type and set it to the LinkControl object. For example:
C#void Test(BarItemLink link) {
BarItemLinkControl lc = link.LinkControl;
//...
}
In this case, it will be necessary to replace the BarItemLinkControl type with IBarItemLinkControl or use var.
- The LinkControl object is used as a parameter for a method that receives FrameworkElement or its descendant.
C#Test(link.LinkControl);
void Test(FrameworkElement element) {
//...
}
In version 18.1, it is necessary to additionally cast objects to this type:
C#Test((FrameworkElement)link.LinkControl);