示例#1
0
        public void SetContent(UIElement content)
        {
            GridContent.FadeOut(Extensions.ContentFadeDuration);

            new Thread(() =>
            {
                Thread.Sleep(Extensions.ContentFadeDuration);

                GridContent.Dispatcher.Invoke(() =>
                {
                    GridContent.Children.Clear();

                    if (content != null)
                    {
                        GridContent.Children.Add(content);
                    }

                    GridContent.FadeIn(Extensions.ContentFadeDuration);

                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                });
            }).Start();
        }