A user control that can be hosted in a DialogControlContainer like a dialog.
Inheritance: System.Windows.Controls.UserControl
示例#1
0
 internal void Close(DialogControl dialog)
 {
     lock (_openLock)
     {
         dialog.Container = null;
         _openDialogs.Remove(dialog);
         ShowMostRecentDialogIfNecessary();
     }
 }
示例#2
0
        private void BindContentAlignment(DialogControl content)
        {
            var hbind = new Binding(HorizontalAlignmentProperty.Name);

            hbind.Source = content;
            hbind.NotifyOnSourceUpdated = true;
            BindingOperations.SetBinding(_presenter, HorizontalAlignmentProperty, hbind);


            var vbind = new Binding(VerticalAlignmentProperty.Name);

            vbind.Source = content;
            vbind.NotifyOnSourceUpdated = true;
            BindingOperations.SetBinding(_presenter, VerticalAlignmentProperty, vbind);
        }
示例#3
0
        static SlideFromDirection DetermineAniDirection(DialogControl content)
        {
            if (content != null)
            {
                if (content.VerticalAlignment == System.Windows.VerticalAlignment.Stretch)
                {
                    switch (content.HorizontalAlignment)
                    {
                    case System.Windows.HorizontalAlignment.Left:
                        return(SlideFromDirection.Left);

                    case System.Windows.HorizontalAlignment.Right:
                        return(SlideFromDirection.Right);
                    }
                }
                else if (content.HorizontalAlignment == System.Windows.HorizontalAlignment.Stretch &&
                         content.VerticalAlignment == System.Windows.VerticalAlignment.Bottom)
                {
                    return(SlideFromDirection.Bottom);
                }
            }
            return(SlideFromDirection.Top);
        }
示例#4
0
        internal void Show(DialogControl dialog)
        {
            if (dialog.Container != null && dialog.Container != this)
            {
                throw new ArgumentException("This dialog already has a container.", "dialog");
            }

            if (Content == dialog)
            {
                return;
            }

            lock (_openLock)
            {
                if (dialog.Container != null)
                {
                    // already somewhere in this stack
                    _openDialogs.Remove(dialog);
                }
                _openDialogs.Add(dialog);
                ShowMostRecentDialogIfNecessary();
            }
        }
 void DoShowContentAnimation(DialogControl content)
 {
     var dir = DetermineAniDirection(content);
     Animation.SlideIn(_presenter, dir, Animation.TypicalDuration, 200, Animation.TypicalEasing);
 }
        private void BindContentAlignment(DialogControl content)
        {
            var hbind = new Binding(HorizontalAlignmentProperty.Name);
            hbind.Source = content;
            hbind.NotifyOnSourceUpdated = true;
            BindingOperations.SetBinding(_presenter, HorizontalAlignmentProperty, hbind);

            var vbind = new Binding(VerticalAlignmentProperty.Name);
            vbind.Source = content;
            vbind.NotifyOnSourceUpdated = true;
            BindingOperations.SetBinding(_presenter, VerticalAlignmentProperty, vbind);
        }
 static SlideFromDirection DetermineAniDirection(DialogControl content)
 {
     if (content != null)
     {
         if (content.VerticalAlignment == System.Windows.VerticalAlignment.Stretch)
         {
             switch (content.HorizontalAlignment)
             {
                 case System.Windows.HorizontalAlignment.Left:
                     return SlideFromDirection.Left;
                 case System.Windows.HorizontalAlignment.Right:
                     return SlideFromDirection.Right;
             }
         }
         else if (content.HorizontalAlignment == System.Windows.HorizontalAlignment.Stretch &&
             content.VerticalAlignment == System.Windows.VerticalAlignment.Bottom)
         {
             return SlideFromDirection.Bottom;
         }
     }
     return SlideFromDirection.Top;
 }
        internal void Show(DialogControl dialog)
        {
            if (dialog.Container != null && dialog.Container != this) { throw new ArgumentException("This dialog already has a container.", "dialog"); }

            if (Content == dialog) { return; }

            lock (_openLock)
            {
                if (dialog.Container != null)
                {
                    // already somewhere in this stack
                    _openDialogs.Remove(dialog);
                }
                _openDialogs.Add(dialog);
                ShowMostRecentDialogIfNecessary();
            }
        }
 internal void Close(DialogControl dialog)
 {
     lock (_openLock)
     {
         dialog.Container = null;
         _openDialogs.Remove(dialog);
         ShowMostRecentDialogIfNecessary();
     }
 }
示例#10
0
        void DoShowContentAnimation(DialogControl content)
        {
            var dir = DetermineAniDirection(content);

            Animation.SlideIn(_presenter, dir, Animation.TypicalDuration, 200, Animation.TypicalEasing);
        }