DesktopIcons
Inheritance: System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector, System.Windows.Markup.IStyleConnector
Exemplo n.º 1
0
        private void SetupPostInit()
        {
            if (Settings.Instance.EnableDesktop && !GroupPolicyManager.Instance.NoDesktop && Icons == null)
            {
                grid.Children.Add(Icons = new DesktopIcons());

                NavigationManager.NavigateHome();

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

            Shell.HideWindowFromTasks(Handle);

            int result = NativeMethods.SetShellWindow(Handle);

            SendToBottom();

            if (Settings.Instance.EnableDesktopOverlayHotKey)
            {
                HotKeyManager.RegisterHotKey(Settings.Instance.DesktopOverlayHotKey, OnShowDesktop);
            }
        }
Exemplo n.º 2
0
        private void Window_SourceInitialized(object sender, EventArgs e)
        {
            this.Top = 0;

            helper = new WindowInteropHelper(this);

            HwndSource source = HwndSource.FromHwnd(helper.Handle);

            source.AddHook(new HwndSourceHook(WndProc));

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

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

            setupPostInit();
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
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();
                }
            }
        }
Exemplo n.º 5
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.DesktopIcons = ((CairoDesktop.DesktopIcons)(target));
     return;
     case 2:
     this.DesktopNavToolbar = ((System.Windows.Controls.Primitives.Popup)(target));
     return;
     case 3:
     
     #line 131 "..\..\Desktop.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Back_Click);
     
     #line default
     #line hidden
     return;
     case 4:
     
     #line 137 "..\..\Desktop.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Home_Click);
     
     #line default
     #line hidden
     return;
     case 5:
     
     #line 143 "..\..\Desktop.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Fwd_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }