Skip to content

Conversation

@batzen
Copy link
Collaborator

@batzen batzen commented Aug 16, 2017

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.

@batzen
Copy link
Collaborator Author

batzen commented Aug 16, 2017

Don't know why the build fails.
Tried to reproduce by using a cleanly checked out version, compiled and ran tests. Everything worked fine.

Copy link
Member

@punker76 punker76 left a 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
Copy link
Member

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

Copy link
Collaborator Author

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?

Copy link
Member

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()));
Copy link
Member

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

Copy link
Collaborator Author

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);
Copy link
Member

@punker76 punker76 Aug 21, 2017

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

Copy link
Collaborator Author

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>
Copy link
Member

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
Copy link
Contributor

Deadpikle commented Aug 22, 2017

Just leaving a note here that this PR probably invalidates #2731 and might mean #2729 is either fixed or needs to "move" repositories. (I haven't tested to find out what the behavior is based on this PR.)

@batzen
Copy link
Collaborator Author

batzen commented Aug 22, 2017

@Deadpikle Those will need to move repositories as i haven't fixed them.

@punker76 punker76 added this to the 1.6.0 milestone Aug 23, 2017
@punker76 punker76 merged commit 2431b50 into MahApps:develop Aug 25, 2017
@batzen batzen deleted the WindowChromeFromControlzEx branch September 13, 2017 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants