So I have an ISL file with all of the controls styled, and I have a particular form where some of the labels need to be styled differently. Ideally I'd like to also have those in the ISL file. My current approach is to define new resources in the ISL file, and then set the specific controls to point to the resource using the StyleResourceName property. The problem is that it doesn't work. The control (UltraLabel) in this case doesn't change. I'm assuming I can just put the name of the resource as it appears in the AppStylist, and then that resource should apply to the control. Does it matter what the ResolutionOrder is set to? Would it be better to use different roles for this kind of styling?
Thanks,
Jason
Hi Jason,
beardo said:I'm assuming I can just put the name of the resource as it appears in the AppStylist
Yes, that's correct.
beardo said:Does it matter what the ResolutionOrder is set to?
Yes, it does matter. I beleive it needs to be set to ApplicationThenControl (which is the default). Have you tried other settings? Does it make any difference?
Can you demonstrate this not working in a small sample project? If so, you should Submit an incident to Infragistics Developer Support so they can check it out.
Mike Saltzman"]Yes, it does matter. I beleive it needs to be set to ApplicationThenControl (which is the default). Have you tried other settings? Does it make any difference? Can you demonstrate this not working in a small sample project? If so, you should Submit an incident to Infragistics Developer Support so they can check it out.
It appears to only work when set to ControlThenApplication. Otherwise it just has the default look.
Beardo
My apologies, it looks like I got it wrong. Since the StyleResourceName is on the Appearance, it gets applied as part of the Control's appearance rather than the Application style. So in this case if your ISL has an appearance already defined for the label control, then that appearance will take precedence over the Resource.
So if you need to have two different appearances for labels in your application, you will either have to use two different StyleSets or two different Style Libraries and then set the StyleSetName or StyleLibraryName on one set of labels or the other.
The alternative is to not apply any styling to your labels in the ISL, but to use Resources for every label.