Example #1
0
        protected override void OnAttached()
        {
            base.OnAttached();

            if (AssociatedObject.IsLoaded)
            {
                _snapManager = new WindowSnapManager(new WindowInteropHelper(AssociatedObject).Handle);
            }
            else
            {
                AssociatedObject.SourceInitialized += AssociatedObjectOnSourceInitialized;
            }
        }
Example #2
0
 private void AssociatedObjectOnSourceInitialized(object sender, EventArgs e)
 {
     AssociatedObject.SourceInitialized -= AssociatedObjectOnSourceInitialized;
     _snapManager = new WindowSnapManager(new WindowInteropHelper(AssociatedObject).Handle);
 }