Example #1
0
        private void Window_SourceInitialized(object sender, EventArgs e)
        {
            Top    = 0;
            helper = new WindowInteropHelper(this);
            Handle = helper.Handle;
            HwndSource.FromHwnd(helper.Handle).AddHook(new HwndSourceHook(WndProc));

            if (Settings.Instance.EnableDesktop && Icons == null)
            {
                grid.Children.Add(Icons = new DesktopIcons());

                string defaultDesktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                string userDesktopPath    = Settings.Instance.DesktopDirectory;

                // first run won't have desktop directory set
                if (string.IsNullOrWhiteSpace(userDesktopPath))
                {
                    Settings.Instance.DesktopDirectory = defaultDesktopPath;
                    userDesktopPath = defaultDesktopPath;
                }

                if (Directory.Exists(userDesktopPath))
                {
                    NavigationManager.NavigateTo(userDesktopPath);
                }
                else if (Directory.Exists(defaultDesktopPath))
                {
                    NavigationManager.NavigateTo(defaultDesktopPath);
                }

                if (Settings.Instance.EnableDynamicDesktop)
                {
                    TryAndEat(() =>
                    {
                        DesktopNavigationToolbar nav = new DesktopNavigationToolbar()
                        {
                            Owner = this, NavigationManager = NavigationManager
                        };
                        nav.Show();
                    });
                }
            }

            SetupPostInit();
        }
Example #2
0
        private void Window_SourceInitialized(object sender, EventArgs e)
        {
            Top    = 0;
            helper = new WindowInteropHelper(this);
            HwndSource.FromHwnd(helper.Handle).AddHook(new HwndSourceHook(WndProc));

            if (Settings.EnableDesktop && Icons == null)
            {
                grid.Children.Add(Icons = new DesktopIcons());
                if (Settings.EnableDynamicDesktop)
                {
                    TryAndEat(() =>
                    {
                        DesktopNavigationToolbar nav = new DesktopNavigationToolbar()
                        {
                            Owner = this
                        };
                        nav.Show();
                    });
                }
            }

            SetupPostInit();
        }
Example #3
0
        private void Window_Activated(object sender, EventArgs e)
        {
            int result = NativeMethods.SetShellWindow(helper.Handle);
            Shell.ShowWindowBottomMost(helper.Handle);

            if (Properties.Settings.Default.EnableDesktop && Icons == null)
            {
                Icons = new DesktopIcons();
                grid.Children.Add(Icons);

                if (Properties.Settings.Default.EnableDynamicDesktop)
                {
                    DesktopNavigationToolbar nav = new DesktopNavigationToolbar() { Owner = this };
                    nav.Show();
                }
            }
        }