I have a ContentPane which I set the BorderThickness to 0 for because of the styling (the border in the middle of whitespace looks bad). However, when the pane is in a floating window (undocked), I would like the border back so you can see the edge over the rest of the app. I thought to make a style trigger, but I can't find an appropriate property to use.
Is there a way I can make this happen?
Hello Walter,
Thank you for the update. And thank you for sharing your solution to this behavior.
I was able to achieve what I wanted with this behavior:
internal class PaneToolWindowBorderBehavior : Behavior<ContentPane> { #region Event Handlers protected override void OnAttached () { base.OnAttached();
base.AssociatedObject.MouseEnter += MouseEnter; base.AssociatedObject.DragEnter += MouseEnter; }
protected override void OnDetaching () { base.OnDetaching();
base.AssociatedObject.MouseEnter -= MouseEnter; base.AssociatedObject.DragEnter -= MouseEnter; }
private void MouseEnter (object sender, RoutedEventArgs e) { if (!(Utilities.GetAncestorFromType(base.AssociatedObject as DependencyObject, typeof(PaneToolWindow), true) is null)) { base.AssociatedObject.BorderThickness = new Thickness(1.0); } else { base.AssociatedObject.BorderThickness = new Thickness(0.0); } } #endregion }
Hi Walter,
The panes will need to be retemplated. The border is provided by the PaneToolWindow. You can retemplate that element to change its look. The default styles folder for the WPF controls are located at your installed location. It defaults here:
C:\Program Files\Infragistics\NetAdvantage 20xx.x\WPF\DefaultStyles\
Let me know if you have any questions.