Repository: microsoft/PowerToys
File: src/settings-ui/Settings.UI/SettingsXAML/OobeWindow.xaml.cs (C#)

Code before:
            if (shellPage != null)
            {
                shellPage.NavigateToModule(this.initialModule);
            }

            OobeShellPage.SetRunSharedEventCallback(() =>
            {
                return Constants.PowerLauncherSharedEvent();
            });

            OobeShellPage.SetColorPickerSharedEventCallback(() =>
            {
                return Constants.ShowColorPickerSharedEvent();
            });

            OobeShellPage.SetOpenMainWindowCallback((Type type) =>
            {
                App.OpenSettingsWindow(type);
            });
        }

        public void SetAppWindow(PowerToysModules module)
        {
            if (shellPage != null)
            {
                shellPage.NavigateToModule(this.initialModule);
            }
        }

        private void OobeWindow_SizeChanged(object sender, WindowSizeChangedEventArgs args)
        {
            var dpi = NativeMethods.GetDpiForWindow(_hWnd);
            if (_currentDPI != dpi)
            {
                // Reacting to a DPI change. Should not cause a resize -> sizeChanged loop.
                _currentDPI = dpi;
                float scalingFactor = (float)dpi / DefaultDPI;
                int width = (int)(ExpectedWidth * scalingFactor);
                int height = (int)(ExpectedHeight * scalingFactor);
                SizeInt32 size;
                size.Width = width;
                size.Height = height;
                _appWindow.Resize(size);
            }
        }

        private void Window_Closed(object sender, WindowEventArgs args)
        {
            App.ClearOobeWindow();

            var mainWindow = App.GetSettingsWindow();

Review comment (suggestion):
Shouldn't this be `module`, or this method parameter is redundant.

```suggestion
                shellPage.NavigateToModule(module);
```

Code after:
            if (shellPage != null)
            {
                shellPage.NavigateToModule(this.initialModule);
            }

            OobeShellPage.SetRunSharedEventCallback(() =>
            {
                return Constants.PowerLauncherSharedEvent();
            });

            OobeShellPage.SetColorPickerSharedEventCallback(() =>
            {
                return Constants.ShowColorPickerSharedEvent();
            });

            OobeShellPage.SetOpenMainWindowCallback((Type type) =>
            {
                App.OpenSettingsWindow(type);
            });
        }

        public void SetAppWindow(PowerToysModules module)
        {
            if (shellPage != null)
            {
                shellPage.NavigateToModule(module);
            }
        }

        private void OobeWindow_SizeChanged(object sender, WindowSizeChangedEventArgs args)
        {
            var dpi = NativeMethods.GetDpiForWindow(_hWnd);
            if (_currentDPI != dpi)
            {
                // Reacting to a DPI change. Should not cause a resize -> sizeChanged loop.
                _currentDPI = dpi;
                float scalingFactor = (float)dpi / DefaultDPI;
                int width = (int)(ExpectedWidth * scalingFactor);
                int height = (int)(ExpectedHeight * scalingFactor);
                SizeInt32 size;
                size.Width = width;
                size.Height = height;
                _appWindow.Resize(size);
            }
        }

        private void Window_Closed(object sender, WindowEventArgs args)
        {
            App.ClearOobeWindow();

            var mainWindow = App.GetSettingsWindow();