-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Replacing WindowChrome and related things with reference to ControlzEx #3021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… WindowChromeFromControlzEx
|
Don't know why the build fails. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@batzen he Bastian, please look at my comments. if there any questions ping me at gitter
| using MahApps.Metro.Controls; | ||
| using Microsoft.Windows.Shell; | ||
|
|
||
| public class BorderlessWindowBehavior : WindowChromeBehavior |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be marked as obsolete by using the new WindowChromeBehavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should this be marked obsolete?
Should we bind things like ResizeBorderThicknessProperty and GlowBrushProperty in InitializeStylizedBehaviors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@batzen uuups, didn't see the inheritence ...
| /// Using a DependencyProperty as the backing store for ResizeBorderTickness. This enables animation, styling, binding, etc... | ||
| /// </summary> | ||
| public static readonly DependencyProperty ResizeBorderThicknessProperty = | ||
| DependencyProperty.Register(nameof(ResizeBorderThickness), typeof(Thickness), typeof(MetroWindow), new PropertyMetadata(BorderlessWindowBehavior.GetDefaultResizeBorderThickness())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be WindowChromeBehavior instead of the old BorderlessWindowBehavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will use base class name here.
| { | ||
| var behavior = new BorderlessWindowBehavior(); | ||
|
|
||
| Interaction.GetBehaviors(this).Add(behavior); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all behaviors must be add here and not at the style
private void InitializeStylizedBehaviors()
{
var collection = new StylizedBehaviorCollection();
collection.Add(new BorderlessWindowBehavior());
collection.Add(new WindowsSettingBehaviour());
collection.Add(new GlowWindowBehavior());
StylizedBehaviors.SetBehaviors(this, collection);
}
without that, the glow and settings behaviors are not working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will move behavior creation from the style to code behind.
| <Behaviours:GlowWindowBehavior /> | ||
| </Behaviours:StylizedBehaviorCollection> | ||
| </Setter.Value> | ||
| </Setter> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setting the behaviors must be done in InitializeStylizedBehaviors at code behind
|
@Deadpikle Those will need to move repositories as i haven't fixed them. |
System.Windows.Interactivity is now aquired through the dependency to ControlzEx
Everything related to WindowChrome and it's associated Behavior is replaced with a reference to ControlzEx.
This also massively increases resize performance of the window.