Beispiel #1
0
        private static void OnContentChange(object sender, DependencyPropertyChangedEventArgs e)
        {
            WorkFrame frame = (WorkFrame)sender;

            if (e.OldValue != null)
            {
                ((WorkPage)e.OldValue).Frame = null;
            }
            if (e.NewValue != null)
            {
                ((WorkPage)e.NewValue).Frame = (WorkFrame)sender;
                if (frame.ContentControl != null)
                {
                    frame.ContentControl.Content = e.NewValue;
                }
            }
            else
            {
                if (e.OldValue != null && frame.Close != null)
                {
                    frame.Close(frame, null);
                }
            }
        }