├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── bug-report.yml │ ├── config.yml │ ├── documentation-issue.yml │ ├── feature-request.yml │ └── localization-translation-issue.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Directory.Build.props ├── LICENSE ├── ModernFlyouts.Core ├── AppInformation │ ├── SourceAppInfo.cs │ ├── SourceAppInfoData.cs │ ├── SourceDesktopAppInfo.cs │ └── SourceModernAppInfo.cs ├── Display │ ├── BrightnessController.cs │ ├── BrightnessManager.cs │ ├── DisplayManager.cs │ └── DisplayMonitor.cs ├── Helpers │ └── BitmapHelper.cs ├── Interop │ ├── BandWindow.cs │ ├── KeyboardHook.cs │ ├── NativeFlyoutHandler.cs │ ├── NativeMethods.cs │ ├── WindowsTaskbar.cs │ ├── WndProcHookManager.cs │ └── Wnf.cs ├── Media │ ├── Control │ │ ├── GSMTCMediaSession.cs │ │ ├── GSMTCMediaSessionManager.cs │ │ ├── MediaSession.cs │ │ ├── MediaSessionManager.cs │ │ ├── NowPlayingMediaSession.cs │ │ └── NowPlayingMediaSessionManager.cs │ ├── MediaPlaybackAutoRepeatMode.cs │ ├── MediaPlaybackTrackChangeDirection.cs │ └── MediaPlaybackType.cs ├── ModernFlyouts.Core.csproj ├── Properties │ └── AssemblyInfo.cs ├── Threading │ ├── DebounceDispatcher.cs │ └── UiTask.cs ├── UI │ └── FlyoutWindow │ │ ├── Enums.cs │ │ ├── FlyoutWindow.Animations.cs │ │ ├── FlyoutWindow.Events.cs │ │ ├── FlyoutWindow.OnScreen.cs │ │ ├── FlyoutWindow.Properties.cs │ │ ├── FlyoutWindow.Tray.cs │ │ └── FlyoutWindow.cs └── Utilities │ ├── AirplaneModeWatcher.cs │ ├── AudioDeviceNotificationClient.cs │ ├── BrightnessWatcher.cs │ ├── IconExtractor.cs │ └── NpsmService.cs ├── ModernFlyouts.Package ├── Images │ ├── LargeTile.scale-100.png │ ├── LargeTile.scale-125.png │ ├── LargeTile.scale-150.png │ ├── LargeTile.scale-200.png │ ├── LargeTile.scale-400.png │ ├── LockScreenLogo.scale-200.png │ ├── SmallTile.scale-100.png │ ├── SmallTile.scale-125.png │ ├── SmallTile.scale-150.png │ ├── SmallTile.scale-200.png │ ├── SmallTile.scale-400.png │ ├── SplashScreen.scale-100.png │ ├── SplashScreen.scale-125.png │ ├── SplashScreen.scale-150.png │ ├── SplashScreen.scale-200.png │ ├── SplashScreen.scale-400.png │ ├── Square150x150Logo.scale-100.png │ ├── Square150x150Logo.scale-125.png │ ├── Square150x150Logo.scale-150.png │ ├── Square150x150Logo.scale-200.png │ ├── Square150x150Logo.scale-400.png │ ├── Square44x44Logo.altform-lightunplated_targetsize-16.png │ ├── Square44x44Logo.altform-lightunplated_targetsize-24.png │ ├── Square44x44Logo.altform-lightunplated_targetsize-256.png │ ├── Square44x44Logo.altform-lightunplated_targetsize-32.png │ ├── Square44x44Logo.altform-lightunplated_targetsize-48.png │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ ├── Square44x44Logo.altform-unplated_targetsize-32.png │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ ├── Square44x44Logo.scale-100.png │ ├── Square44x44Logo.scale-125.png │ ├── Square44x44Logo.scale-150.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.scale-400.png │ ├── Square44x44Logo.targetsize-16.png │ ├── Square44x44Logo.targetsize-24.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── Square44x44Logo.targetsize-256.png │ ├── Square44x44Logo.targetsize-32.png │ ├── Square44x44Logo.targetsize-48.png │ ├── StoreLogo.backup.png │ ├── StoreLogo.scale-100.png │ ├── StoreLogo.scale-125.png │ ├── StoreLogo.scale-150.png │ ├── StoreLogo.scale-200.png │ ├── StoreLogo.scale-400.png │ ├── Wide310x150Logo.scale-100.png │ ├── Wide310x150Logo.scale-125.png │ ├── Wide310x150Logo.scale-150.png │ ├── Wide310x150Logo.scale-200.png │ └── Wide310x150Logo.scale-400.png ├── ModernFlyouts.Package.wapproj ├── Package.appinstaller ├── Package.appxmanifest ├── Strings │ └── en-us │ │ └── Resources.resw └── priconfig.default.xml ├── ModernFlyouts.sln ├── ModernFlyouts ├── App.config ├── App.xaml ├── App.xaml.cs ├── AppLifecycle │ ├── AppDataMigration.cs │ ├── AppLifecycleManager.cs │ └── RelaunchHelper.cs ├── Assets │ ├── Images │ │ ├── DefaultAudioThumbnail.png │ │ ├── DefaultImageThumbnail.png │ │ ├── DefaultVideoThumbnail.png │ │ ├── ModernFlyouts_1024.png │ │ ├── ModernFlyouts_128.png │ │ ├── ModernFlyouts_16.png │ │ ├── ModernFlyouts_24.png │ │ ├── ModernFlyouts_256.png │ │ ├── ModernFlyouts_32.png │ │ ├── ModernFlyouts_48.png │ │ ├── ModernFlyouts_512.png │ │ ├── ModernFlyouts_64.png │ │ ├── ModernFlyouts_96.png │ │ ├── ModernFlyouts_Black_1024.png │ │ ├── ModernFlyouts_Black_16.png │ │ ├── ModernFlyouts_White_1024.png │ │ ├── ModernFlyouts_White_16.png │ │ ├── ModernFlyouts_White_16_mod.png │ │ ├── ModernFlyouts_White_24.png │ │ ├── ModernFlyouts_White_30.png │ │ ├── ModernFlyouts_White_36.png │ │ ├── ModernFlyouts_White_48.png │ │ ├── ModernFlyouts_White_96.png │ │ └── Readme_Banner.png │ ├── Logo.ico │ ├── Logo_Tray_Black.ico │ └── Logo_Tray_White.ico ├── Behaviors │ └── DragFlyoutBehavior.cs ├── Controls │ ├── AirplaneModeControl.xaml │ ├── AirplaneModeControl.xaml.cs │ ├── AutoScaleCanvas.cs │ ├── BrightnessControl.xaml │ ├── BrightnessControl.xaml.cs │ ├── ContentScrollViewer.cs │ ├── CrossFadeContentControl.cs │ ├── DirectableStackPanel.cs │ ├── DisplayMonitorPicker.xaml │ ├── DisplayMonitorPicker.xaml.cs │ ├── FlyoutAlignmentPicker.xaml │ ├── FlyoutAlignmentPicker.xaml.cs │ ├── FlyoutTopBar.xaml │ ├── FlyoutTopBar.xaml.cs │ ├── LockKeysControl.xaml │ ├── LockKeysControl.xaml.cs │ ├── ScrollViewerEx.cs │ ├── SessionControl.xaml │ ├── SessionControl.xaml.cs │ ├── SessionsPanel.xaml │ ├── SessionsPanel.xaml.cs │ ├── VolumeControl.xaml │ └── VolumeControl.xaml.cs ├── Converters │ ├── DisplayMonitorIsCheckedConverter.cs │ ├── DisplayMonitorPositionConverter.cs │ ├── EnumToLocalizedStringConverter.cs │ ├── IndexToVisibilityConverter.cs │ ├── InvertBooleanToVisibilityConverter.cs │ ├── MediaSessionControlConverters.cs │ ├── ScrollButtonVisibilityConverter.cs │ └── TextToTooltipEnabledConverter.cs ├── DesignTime │ └── MockMediaSession.cs ├── Flyout Helpers │ ├── AirplaneModeFlyoutHelper.cs │ ├── AudioFlyoutHelper.cs │ ├── BrightnessFlyoutHelper.cs │ ├── FlyoutHelperBase.cs │ ├── FlyoutTriggerData.cs │ └── LockKeysFlyoutHelper.cs ├── FlyoutHandler.cs ├── Helpers │ ├── AppDataHelper.cs │ ├── DefaultValuesStore.cs │ ├── LocalizationHelper.cs │ ├── PackUriHelper.cs │ ├── ScrollViewerHelperEx.cs │ ├── StartupHelper.cs │ ├── UpdateHelpers.cs │ └── WindowPlacementHelper.cs ├── Input │ ├── InputHelper.cs │ ├── TappedEventHandler.cs │ └── TappedRoutedEventArgs.cs ├── Interop │ └── ShellMessageHookHandler.cs ├── JumpListHelper.cs ├── ModernFlyouts.csproj ├── MultilingualResources │ ├── ModernFlyouts.af.xlf │ ├── ModernFlyouts.ar.xlf │ ├── ModernFlyouts.da-DK.xlf │ ├── ModernFlyouts.de.xlf │ ├── ModernFlyouts.el.xlf │ ├── ModernFlyouts.en-GB.xlf │ ├── ModernFlyouts.es.xlf │ ├── ModernFlyouts.fa.xlf │ ├── ModernFlyouts.fr.xlf │ ├── ModernFlyouts.he.xlf │ ├── ModernFlyouts.hi.xlf │ ├── ModernFlyouts.hu.xlf │ ├── ModernFlyouts.id.xlf │ ├── ModernFlyouts.is.xlf │ ├── ModernFlyouts.it.xlf │ ├── ModernFlyouts.ja.xlf │ ├── ModernFlyouts.ko.xlf │ ├── ModernFlyouts.ms.xlf │ ├── ModernFlyouts.nb.xlf │ ├── ModernFlyouts.nl.xlf │ ├── ModernFlyouts.pl.xlf │ ├── ModernFlyouts.pt.xlf │ ├── ModernFlyouts.ru.xlf │ ├── ModernFlyouts.sv.xlf │ ├── ModernFlyouts.tr.xlf │ ├── ModernFlyouts.uk.xlf │ ├── ModernFlyouts.vi.xlf │ ├── ModernFlyouts.zh-CN.xlf │ ├── ModernFlyouts.zh-Hans.xlf │ ├── ModernFlyouts.zh-Hant.xlf │ └── ModernFlyouts.zh-TW.xlf ├── Navigation │ ├── AboutPage.xaml │ ├── AboutPage.xaml.cs │ ├── AirplaneModeModulePage.xaml │ ├── AirplaneModeModulePage.xaml.cs │ ├── AudioModulePage.xaml │ ├── AudioModulePage.xaml.cs │ ├── BrightnessModulePage.xaml │ ├── BrightnessModulePage.xaml.cs │ ├── GeneralSettingsPage.xaml │ ├── GeneralSettingsPage.xaml.cs │ ├── LayoutPage.xaml │ ├── LayoutPage.xaml.cs │ ├── LockKeysModulePage.xaml │ ├── LockKeysModulePage.xaml.cs │ ├── PersonalizationPage.xaml │ └── PersonalizationPage.xaml.cs ├── Private │ └── Screenshots │ │ └── ScreenshotHelper.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── DesignTimeResources.xaml │ ├── PublishProfiles │ │ ├── win10-arm64.pubxml │ │ ├── win10-x64.pubxml │ │ └── win10-x86.pubxml │ ├── Strings.Designer.cs │ ├── Strings.af.resx │ ├── Strings.ar.resx │ ├── Strings.da-DK.resx │ ├── Strings.de.resx │ ├── Strings.el.resx │ ├── Strings.en-GB.resx │ ├── Strings.es.resx │ ├── Strings.fa.resx │ ├── Strings.fr.resx │ ├── Strings.he.resx │ ├── Strings.hi.resx │ ├── Strings.hu.resx │ ├── Strings.id.resx │ ├── Strings.is.resx │ ├── Strings.it.resx │ ├── Strings.ja.resx │ ├── Strings.ko.resx │ ├── Strings.ms.resx │ ├── Strings.nb.resx │ ├── Strings.nl.resx │ ├── Strings.pl.resx │ ├── Strings.pt.resx │ ├── Strings.resx │ ├── Strings.ru.resx │ ├── Strings.sv.resx │ ├── Strings.tr.resx │ ├── Strings.uk.resx │ ├── Strings.vi.resx │ ├── Strings.zh-CN.resx │ ├── Strings.zh-Hans.resx │ ├── Strings.zh-Hant.resx │ └── Strings.zh-TW.resx ├── SettingsWindow.xaml ├── SettingsWindow.xaml.cs ├── Styles │ ├── Button.xaml │ ├── ContentScrollViewer.xaml │ └── ToggleButton.xaml ├── ThemeResources │ ├── Dark.xaml │ ├── Dark │ │ └── RevealBrush.xaml │ ├── HighContrast.xaml │ ├── HighContrast │ │ └── RevealBrush.xaml │ ├── Light.xaml │ ├── Light │ │ └── RevealBrush.xaml │ └── ToolkitThemeDictionary.cs ├── Themes │ └── Generic.xaml ├── UI │ ├── Fluent │ │ └── Media │ │ │ ├── RevealBackgroundBrushHelper.cs │ │ │ ├── RevealBorderBrushHelper.cs │ │ │ └── RevealBrushHelper.cs │ ├── Media │ │ ├── Animation │ │ │ └── GridLengthAnimation.cs │ │ └── BindablePoint.cs │ ├── SystemTheme.cs │ ├── TrayIconManager.cs │ └── UIManager.cs ├── Utilities │ ├── CommonCommands.cs │ └── CommonIcons.cs ├── Views │ ├── FlyoutView.xaml │ └── FlyoutView.xaml.cs ├── Workarounds │ └── RenderLoopFix.cs └── app.manifest ├── ModernFlyoutsBridge ├── ModernFlyoutsBridge.vcxproj ├── Source.def ├── dllmain.cpp └── inc │ └── hostfxr.h ├── ModernFlyoutsHost ├── ModernFlyoutsHost.vcxproj ├── ModernFlyoutsHost_A64.exe ├── ModernFlyoutsHost_x64.exe ├── ModernFlyoutsHost_x86.exe ├── hostfxr_A64.dll ├── hostfxr_x64.dll └── hostfxr_x86.dll ├── NOTICE.md ├── Privacy.md ├── README.md ├── azure-pipelines.yml ├── docs ├── GSMTC-Support-And-Popular-Apps.md ├── _config.yml ├── contribution_workflow.md ├── developer_guide.md ├── images │ ├── Airplane_Old.png │ ├── Airplane_On.png │ ├── Airplane_On_Dark.png │ ├── Airplane_On_Dark_NoTop.png │ ├── Airplane_On_Light.png │ ├── Airplane_On_Light_NoTop.png │ ├── Airplane_On_NoTop.png │ ├── Audio.png │ ├── Audio_Dark.png │ ├── Audio_Dark_NoTop.png │ ├── Audio_Light.png │ ├── Audio_Light_NoTop.png │ ├── Audio_NoTop.png │ ├── Audio_Old.png │ ├── Audio_Old_Session.png │ ├── Audio_Session_Music_NoTop.png │ ├── Audio_Session_Music_NoTop_More.png │ ├── Audio_Session_Music_NoTop_NoAlbumArt.png │ ├── Audio_Session_Video.png │ ├── Brightness-Compacted.png │ ├── Brightness-Compacted_NoTop.png │ ├── Brightness.png │ ├── Brightness_Dark.png │ ├── Brightness_Dark_NoTop.png │ ├── Brightness_Light.png │ ├── Brightness_Light_NoTop.png │ ├── Brightness_NoTop.png │ ├── Brightness_Old.png │ ├── Brightness_compacted.png │ ├── LockKey_Caps.png │ ├── LockKey_Caps_Dark.png │ ├── LockKey_Caps_Dark_NoTop.png │ ├── LockKey_Caps_Light.png │ ├── LockKey_Caps_Light_NoTop.png │ ├── LockKey_Caps_NoTop.png │ ├── ModernFlyouts_heroart.png │ ├── ModernFlyouts_heroart_old.png │ └── Overview.png └── release_notes.md └── winget-pkgs └── ModernFlyouts ├── 0.6.0.0.yaml └── 0.7.0.0.yaml /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | name: "🐛 Bug report" 2 | description: Report errors or unexpected behavior 3 | labels: 4 | - Bug 5 | 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Thanks for taking the time to fill out this bug! 11 | Please make sure to [search for existing issues](https://github.com/ModernFlyouts-Community/ModernFlyouts/issues) before filing a new one! 12 | ***Please create issues in English***, (use google translate if required) 13 | - type: input 14 | attributes: 15 | label: ModernFlyouts Version 16 | placeholder: | 17 | "0.9.1" 18 | description: | 19 | look at Settings 20 | validations: 21 | required: true 22 | 23 | - type: input 24 | attributes: 25 | label: Windows version 26 | placeholder: | 27 | "Windows 10 20H2" 28 | description: | 29 | look at OS Settings 30 | validations: 31 | required: true 32 | 33 | - type: input 34 | attributes: 35 | label: OS build 36 | description: | 37 | Optional - if you know specific build or are on insider preview 38 | placeholder: | 39 | "22523.1000" 40 | validations: 41 | required: false 42 | 43 | - type: dropdown 44 | attributes: 45 | label: Platform 46 | description: Please select OS Platform (x64, ARM64, x86) 47 | multiple: true 48 | options: 49 | - x64 50 | - ARM64 51 | - x86 52 | validations: 53 | required: false 54 | 55 | - type: dropdown 56 | attributes: 57 | label: Area(s) with issue? 58 | description: What things had an issue? Check all that apply. 59 | multiple: true 60 | options: 61 | - General 62 | - Audio Flyout 63 | - Media Flyout 64 | - Lock keys Flyout 65 | - Battery Flyout 66 | - Audio Tray Flyout 67 | - Camera Flyout 68 | - Mic Flyout 69 | - Welcome / ModernFlyouts OOBE 70 | - System tray 71 | - Installer 72 | validations: 73 | required: false 74 | 75 | - type: textarea 76 | attributes: 77 | label: Steps to reproduce 78 | description: We highly suggest including screenshots. 79 | placeholder: Tell us the steps required to trigger your bug. 80 | validations: 81 | required: true 82 | 83 | - type: textarea 84 | attributes: 85 | label: ✔️ Expected Behavior 86 | placeholder: What were you expecting? 87 | validations: 88 | required: false 89 | 90 | - type: textarea 91 | attributes: 92 | label: ❌ Actual Behavior 93 | placeholder: What happened instead? 94 | validations: 95 | required: true 96 | 97 | - type: textarea 98 | attributes: 99 | label: Other Software 100 | description: If you're reporting a bug about our interaction with other software, what software? What versions? 101 | placeholder: | 102 | Chromium Browser (Edge, Chrome, Vivaldi, Brave ...) 103 | Firefox 104 | Spotify (Please specify which app - Web app, PWA, UWP, Desktop, Store) 105 | Groove Music 106 | Media Player 107 | VLC 108 | ETC ... 109 | validations: 110 | required: false 111 | 112 | - type: textarea 113 | attributes: 114 | label: Additional Context 115 | placeholder: Add any other info about the problem 116 | validations: 117 | required: false 118 | 119 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: "\U0001F4DA ModernFlyouts user documentation" 4 | url: https://modernflyouts-community.github.io/docs/#/ 5 | about: Documentation for users of ModernFlyouts 6 | - name: "\U0001F4DA ModernFlyouts dev documentation" 7 | url: https://modernflyouts-community.github.io/docs/#/ 8 | about: Documentation for people interested in developing and contributing for ModernFlyouts 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation-issue.yml: -------------------------------------------------------------------------------- 1 | name: "📚 Documentation Issue" 2 | description: Report issues in our documentation 3 | labels: 4 | - Documentation 5 | body: 6 | - type: textarea 7 | attributes: 8 | label: Provide a description of requested docs changes 9 | placeholder: Briefly describe which document needs to be corrected and why. 10 | validations: 11 | required: true 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | name: "⭐ Feature request" 2 | description: Suggest an idea for this app 3 | labels: 4 | - Enhancement 5 | 6 | body: 7 | - type: textarea 8 | attributes: 9 | label: Description of the new feature / enhancement 10 | placeholder: | 11 | What is the expected behavior of the proposed feature? 12 | validations: 13 | required: true 14 | - type: textarea 15 | attributes: 16 | label: Scenario when this would be used? 17 | placeholder: | 18 | What is the scenario this would be used? 19 | validations: 20 | required: true 21 | - type: textarea 22 | attributes: 23 | label: Additional context 24 | placeholder: | 25 | Add any other context, screenshots or mockups for the feature request here. 26 | validations: 27 | required: false 28 | - type: markdown 29 | attributes: 30 | value: | 31 | **Please limit one request per issue.** 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/localization-translation-issue.yml: -------------------------------------------------------------------------------- 1 | name: "🌐 Localization/Translation issue" 2 | description: Report incorrect translations, or request support for a language 3 | labels: 4 | - Translation 5 | assignees: 6 | - Samuel12321 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: | 11 | Please make sure to [search for existing issues](https://github.com/ModernFlyouts-Community/ModernFlyouts/issues) before filing a new one! 12 | - type: input 13 | attributes: 14 | label: ModernFlyouts version 15 | placeholder: "0.9.0" 16 | description: | 17 | look at Settings 18 | validations: 19 | required: true 20 | - type: dropdown 21 | attributes: 22 | label: Area with translation issue 23 | options: 24 | - General 25 | - Settings 26 | - Flyouts 27 | validations: 28 | required: false 29 | - type: input 30 | attributes: 31 | label: 🌐 Language affected or requested 32 | description: | 33 | for Additional language requests please give ISO language code eg: en-us or zh-HK 34 | placeholder: "German" 35 | validations: 36 | required: true 37 | 38 | - type: textarea 39 | attributes: 40 | label: ❌ Actual phrase(s) 41 | description: | 42 | for incorrect translations 43 | placeholder: What is there? Please include a screenshot as that is extremely helpful. 44 | validations: 45 | required: false 46 | - type: textarea 47 | attributes: 48 | label: ✔️ Expected phrase(s) 49 | description: | 50 | for incorrect translations 51 | placeholder: What was expected? 52 | validations: 53 | required: false 54 | - type: textarea 55 | attributes: 56 | label: ℹ Why is the current translation wrong 57 | placeholder: Why do you feel this is incorrect? 58 | validations: 59 | required: false 60 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at shankarbus04082001@hotmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | ModernFlyouts Community 4 | latest 5 | 0.10.0 6 | 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Shankar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/AppInformation/SourceAppInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using static ModernFlyouts.Core.Interop.NativeMethods; 5 | 6 | namespace ModernFlyouts.Core.AppInformation 7 | { 8 | public abstract class SourceAppInfo : IDisposable 9 | { 10 | private bool disposedValue; 11 | 12 | #region Properties 13 | 14 | public Stream LogoStream { get; protected set; } 15 | 16 | public string DisplayName { get; protected set; } = string.Empty; 17 | 18 | protected SourceAppInfoData Data { get; set; } 19 | 20 | #endregion 21 | 22 | public abstract event EventHandler InfoFetched; 23 | 24 | public static SourceAppInfo FromData(SourceAppInfoData data) 25 | { 26 | if (data.DataType == SourceAppInfoDataType.FromAppUserModelId) 27 | { 28 | if (string.IsNullOrEmpty(data.AppUserModelId) 29 | || string.IsNullOrWhiteSpace(data.AppUserModelId)) 30 | return null; 31 | 32 | if (IsAppUnpackaged(data)) 33 | { 34 | return new SourceDesktopAppInfo(data); 35 | } 36 | else 37 | { 38 | return new SourceModernAppInfo(data); 39 | } 40 | } 41 | else if (data.DataType == SourceAppInfoDataType.FromProcessId) 42 | { 43 | if (data.ProcessId == 0) 44 | return null; 45 | 46 | if (IsAppPackaged(data)) 47 | { 48 | return new SourceModernAppInfo(data); 49 | } 50 | else 51 | { 52 | return new SourceDesktopAppInfo(data); 53 | } 54 | } 55 | 56 | return null; 57 | } 58 | 59 | public static SourceAppInfo FromAppUserModelId(string appUserModelId) 60 | { 61 | SourceAppInfoData data = new() 62 | { 63 | AppUserModelId = appUserModelId, 64 | DataType = SourceAppInfoDataType.FromAppUserModelId 65 | }; 66 | 67 | return FromData(data); 68 | } 69 | 70 | public static SourceAppInfo FromProcessId(uint processId, IntPtr hWnd = default) 71 | { 72 | SourceAppInfoData data = new() 73 | { 74 | ProcessId = processId, 75 | MainWindowHandle = hWnd, 76 | DataType = SourceAppInfoDataType.FromProcessId 77 | }; 78 | 79 | return FromData(data); 80 | } 81 | 82 | public abstract void Activate(); 83 | 84 | public abstract void FetchInfosAsync(); 85 | 86 | protected virtual void Disconnect() 87 | { 88 | } 89 | 90 | internal static bool IsAppUnpackaged(SourceAppInfoData data) 91 | { 92 | return data.AppUserModelId.EndsWith(".exe", StringComparison.OrdinalIgnoreCase); 93 | } 94 | 95 | internal static bool IsAppPackaged(SourceAppInfoData data) 96 | { 97 | using var process = Process.GetProcessById((int)data.ProcessId); 98 | return IsImmersiveProcess(process.Handle); 99 | } 100 | 101 | public void Dispose() 102 | { 103 | if (!disposedValue) 104 | { 105 | Disconnect(); 106 | LogoStream?.Dispose(); 107 | LogoStream = null; 108 | disposedValue = true; 109 | } 110 | GC.SuppressFinalize(this); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/AppInformation/SourceAppInfoData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ModernFlyouts.Core.AppInformation 4 | { 5 | public enum SourceAppInfoDataType 6 | { 7 | FromProcessId, 8 | FromAppUserModelId 9 | } 10 | 11 | public class SourceAppInfoData 12 | { 13 | public string AppUserModelId { get; init; } 14 | 15 | public IntPtr MainWindowHandle { get; init; } 16 | 17 | public uint ProcessId { get; init; } 18 | 19 | public SourceAppInfoDataType DataType { get; init; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Display/DisplayMonitor.cs: -------------------------------------------------------------------------------- 1 | using CommunityToolkit.Mvvm.ComponentModel; 2 | using System; 3 | using System.Windows; 4 | 5 | namespace ModernFlyouts.Core.Display 6 | { 7 | public class DisplayMonitor : ObservableObject, IDisposable 8 | { 9 | internal bool isDefault; 10 | internal bool isStale; 11 | internal string wmiId; 12 | 13 | #region Properties 14 | 15 | private Rect bounds = Rect.Empty; 16 | 17 | public Rect Bounds 18 | { 19 | get => bounds; 20 | internal set => SetProperty(ref bounds, value); 21 | } 22 | 23 | private string deviceId = string.Empty; 24 | 25 | public string DeviceId 26 | { 27 | get => deviceId; 28 | internal set => SetProperty(ref deviceId, value); 29 | } 30 | 31 | public string DeviceName { get; init; } 32 | 33 | private string displayName = string.Empty; 34 | 35 | public string DisplayName 36 | { 37 | get => displayName; 38 | internal set => SetProperty(ref displayName, value); 39 | } 40 | 41 | private IntPtr hMonitor = IntPtr.Zero; 42 | 43 | public IntPtr HMonitor 44 | { 45 | get => hMonitor; 46 | internal set 47 | { 48 | if (SetProperty(ref hMonitor, value)) 49 | { 50 | OnHMonitorUpdated(); 51 | } 52 | } 53 | } 54 | 55 | private int index; 56 | 57 | public int Index 58 | { 59 | get => index; 60 | internal set => SetProperty(ref index, value); 61 | } 62 | 63 | private bool isPrimary; 64 | 65 | public bool IsPrimary 66 | { 67 | get => isPrimary; 68 | internal set => SetProperty(ref isPrimary, value); 69 | } 70 | 71 | private bool isInBuilt; 72 | 73 | public bool IsInBuilt 74 | { 75 | get => isInBuilt; 76 | internal set => SetProperty(ref isInBuilt, value); 77 | } 78 | 79 | private Rect workingArea = Rect.Empty; 80 | 81 | public Rect WorkingArea 82 | { 83 | get => workingArea; 84 | internal set => SetProperty(ref workingArea, value); 85 | } 86 | 87 | #endregion 88 | 89 | internal DisplayMonitor(string deviceName) 90 | { 91 | DeviceName = deviceName; 92 | } 93 | 94 | internal void OnHMonitorUpdated() 95 | { 96 | BrightnessManager.MakeBrightnessControllersForDisplayMonitor(this); 97 | } 98 | 99 | private bool disposedValue; 100 | 101 | protected virtual void Dispose(bool disposing) 102 | { 103 | if (!disposedValue) 104 | { 105 | BrightnessManager.DisposeBrightnessControllerForDisplayMonitor(this); 106 | 107 | disposedValue = true; 108 | } 109 | } 110 | 111 | public void Dispose() 112 | { 113 | Dispose(true); 114 | GC.SuppressFinalize(this); 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Helpers/BitmapHelper.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Windows.Media.Imaging; 3 | 4 | namespace ModernFlyouts.Core.Helpers 5 | { 6 | public class BitmapHelper 7 | { 8 | public static bool TryCreateBitmapImageFromStream(Stream stream, out BitmapSource bitmap) 9 | { 10 | bitmap = null; 11 | 12 | if (stream != null && stream.Length > 0) 13 | { 14 | stream.Seek(0, SeekOrigin.Current); 15 | bitmap = BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad); 16 | return true; 17 | } 18 | 19 | return false; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Interop/KeyboardHook.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Windows.Input; 4 | using static ModernFlyouts.Core.Interop.NativeMethods; 5 | 6 | namespace ModernFlyouts.Core.Interop 7 | { 8 | public class KeyboardHook 9 | { 10 | public event KeyDownEventHandler KeyDown; 11 | 12 | public delegate void KeyDownEventHandler(Key key, int virtualKey); 13 | 14 | public event KeyUpEventHandler KeyUp; 15 | 16 | public delegate void KeyUpEventHandler(Key key, int virtualKey); 17 | 18 | private const int WH_KEYBOARD_LL = 13; 19 | private const int HC_ACTION = 0; 20 | private const int WM_KEYDOWN = 0x100; 21 | private const int WM_KEYUP = 0x101; 22 | private const int WM_SYSKEYDOWN = 0x104; 23 | private const int WM_SYSKEYUP = 0x105; 24 | 25 | private HookProc _procDelegate; 26 | private IntPtr HHookID = IntPtr.Zero; 27 | 28 | #region Properties 29 | 30 | public Key? CurrentKey { get; private set; } 31 | 32 | #endregion 33 | 34 | public KeyboardHook() 35 | { 36 | _procDelegate = new HookProc(KeyboardProc); 37 | var module = System.Diagnostics.Process.GetCurrentProcess().MainModule; 38 | IntPtr handle = GetModuleHandle(module.ModuleName); 39 | HHookID = (IntPtr)SetWindowsHookEx(WH_KEYBOARD_LL, _procDelegate, handle, 0); 40 | if (HHookID == IntPtr.Zero) 41 | { 42 | throw new Exception("Could not set keyboard hook"); 43 | } 44 | } 45 | 46 | private int KeyboardProc(int nCode, IntPtr wParam, IntPtr lParam) 47 | { 48 | if (nCode == HC_ACTION) 49 | { 50 | if (wParam == (IntPtr)WM_KEYDOWN || wParam == (IntPtr)WM_SYSKEYDOWN) 51 | { 52 | var vkcode = (int)((KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT))).vkCode; 53 | var key = KeyInterop.KeyFromVirtualKey(vkcode); 54 | CurrentKey = key; 55 | KeyDown?.Invoke(key, vkcode); 56 | } 57 | if (wParam == (IntPtr)WM_KEYUP || wParam == (IntPtr)WM_SYSKEYUP) 58 | { 59 | var vkcode = (int)((KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT))).vkCode; 60 | var key = KeyInterop.KeyFromVirtualKey(vkcode); 61 | CurrentKey = null; 62 | KeyUp?.Invoke(key, vkcode); 63 | } 64 | } 65 | 66 | return CallNextHookEx((int)IntPtr.Zero, nCode, wParam, lParam); 67 | } 68 | 69 | ~KeyboardHook() 70 | { 71 | if (HHookID != IntPtr.Zero) 72 | { 73 | UnhookWindowsHookEx((int)HHookID); 74 | } 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Interop/WndProcHookManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ModernFlyouts.Core.Interop 5 | { 6 | internal interface IWndProcObject 7 | { 8 | } 9 | 10 | public class WndProcHookManager 11 | { 12 | private Dictionary hooks = new(); 13 | 14 | private List hookHandlers = new(); 15 | 16 | private static Dictionary hookManagers = new(); 17 | 18 | internal static WndProcHookManager RegisterForIWndProcObject(IWndProcObject wndProcObject) 19 | { 20 | if (wndProcObject == null) 21 | throw new ArgumentNullException(nameof(wndProcObject)); 22 | 23 | WndProcHookManager hookManager = new(); 24 | 25 | hookManagers.Add(wndProcObject, hookManager); 26 | 27 | return hookManager; 28 | } 29 | 30 | internal static WndProcHookManager GetForIWndProcObject(IWndProcObject wndProcObject) 31 | { 32 | if (wndProcObject == null) 33 | throw new ArgumentNullException(nameof(wndProcObject)); 34 | 35 | if (hookManagers.TryGetValue(wndProcObject, out var hookManager)) 36 | { 37 | return hookManager; 38 | } 39 | 40 | return null; 41 | } 42 | 43 | public static WndProcHookManager GetForBandWindow(BandWindow bandWindow) 44 | { 45 | return GetForIWndProcObject(bandWindow); 46 | } 47 | 48 | public void RegisterHookHandler(IWndProcHookHandler hookHandler) 49 | { 50 | if (hookHandler == null) 51 | throw new ArgumentNullException(nameof(hookHandler)); 52 | 53 | hookHandlers.Add(hookHandler); 54 | } 55 | 56 | public void RegisterHookHandlerForMessage(uint msg, IWndProcHookHandler hookHandler) 57 | { 58 | if (hookHandler == null) 59 | throw new ArgumentNullException(nameof(hookHandler)); 60 | 61 | hooks.Add(msg, hookHandler.OnWndProc); 62 | } 63 | 64 | public void RegisterCallbackForMessage(uint msg, WndProc callback) 65 | { 66 | if (callback == null) 67 | throw new ArgumentNullException(nameof(callback)); 68 | 69 | hooks.Add(msg, callback); 70 | } 71 | 72 | internal void OnHwndCreated(IntPtr hWnd) 73 | { 74 | foreach (var hookHandler in hookHandlers) 75 | { 76 | uint msg = hookHandler.OnHwndCreated(hWnd, out bool register); 77 | if (register) 78 | { 79 | RegisterHookHandlerForMessage(msg, hookHandler); 80 | } 81 | } 82 | } 83 | 84 | internal IntPtr TryHandleWindowMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam, out bool handled) 85 | { 86 | handled = false; 87 | 88 | if (hooks.TryGetValue(msg, out var hook)) 89 | { 90 | handled = true; 91 | return hook(hWnd, msg, wParam, lParam); 92 | } 93 | 94 | return IntPtr.Zero; 95 | } 96 | } 97 | 98 | public interface IWndProcHookHandler 99 | { 100 | public uint OnHwndCreated(IntPtr hWnd, out bool register); 101 | 102 | public IntPtr OnWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Media/Control/GSMTCMediaSessionManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using Windows.Media.Control; 4 | 5 | namespace ModernFlyouts.Core.Media.Control 6 | { 7 | public class GSMTCMediaSessionManager : MediaSessionManager 8 | { 9 | private GlobalSystemMediaTransportControlsSessionManager GSMTCSessionManager; 10 | 11 | public override async void OnEnabled() 12 | { 13 | try 14 | { 15 | GSMTCSessionManager = await GlobalSystemMediaTransportControlsSessionManager.RequestAsync(); 16 | GSMTCSessionManager.SessionsChanged += GSMTCSessionsChanged; 17 | 18 | LoadSessions(); 19 | } 20 | catch { } 21 | } 22 | 23 | private void GSMTCSessionsChanged(GlobalSystemMediaTransportControlsSessionManager sender, SessionsChangedEventArgs args) 24 | { 25 | Application.Current.Dispatcher.Invoke(LoadSessions); 26 | } 27 | 28 | private void ClearSessions() 29 | { 30 | foreach (var session in MediaSessions) 31 | { 32 | session.Disconnect(); 33 | } 34 | 35 | MediaSessions.Clear(); 36 | } 37 | 38 | private void LoadSessions() 39 | { 40 | ClearSessions(); 41 | 42 | if (GSMTCSessionManager != null) 43 | { 44 | var sessions = GSMTCSessionManager.GetSessions(); 45 | 46 | foreach (var session in sessions) 47 | { 48 | MediaSessions.Add(new GSMTCMediaSession(session)); 49 | } 50 | } 51 | } 52 | 53 | public override void OnDisabled() 54 | { 55 | try 56 | { 57 | if (GSMTCSessionManager != null) 58 | { 59 | GSMTCSessionManager.SessionsChanged -= GSMTCSessionsChanged; 60 | GSMTCSessionManager = null; 61 | } 62 | 63 | ClearSessions(); 64 | } 65 | catch { } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Media/Control/MediaSessionManager.cs: -------------------------------------------------------------------------------- 1 | using CommunityToolkit.Mvvm.ComponentModel; 2 | using System; 3 | using System.Collections.ObjectModel; 4 | 5 | namespace ModernFlyouts.Core.Media.Control 6 | { 7 | public abstract class MediaSessionManager : ObservableObject 8 | { 9 | public ObservableCollection MediaSessions { get; } = new(); 10 | 11 | private MediaSession currentMediaSession; 12 | 13 | public MediaSession CurrentMediaSession 14 | { 15 | get => currentMediaSession; 16 | protected set 17 | { 18 | if (SetProperty(ref currentMediaSession, value)) 19 | { 20 | RaiseCurrentMediaSessionChanged(); 21 | } 22 | } 23 | } 24 | 25 | public abstract void OnEnabled(); 26 | 27 | public abstract void OnDisabled(); 28 | 29 | public virtual bool ContainsAnySession() 30 | { 31 | return MediaSessions.Count > 0; 32 | } 33 | 34 | protected void RaiseCurrentMediaSessionChanged() 35 | { 36 | CurrentMediaSessionChanged?.Invoke(this, EventArgs.Empty); 37 | } 38 | 39 | protected void RaiseMediaSessionsChanged() 40 | { 41 | MediaSessionsChanged?.Invoke(this, EventArgs.Empty); 42 | } 43 | 44 | public event EventHandler CurrentMediaSessionChanged; 45 | 46 | public event EventHandler MediaSessionsChanged; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Media/MediaPlaybackAutoRepeatMode.cs: -------------------------------------------------------------------------------- 1 | namespace ModernFlyouts.Core.Media 2 | { 3 | /// 4 | /// Specifies the auto repeat mode for media playback. 5 | /// 6 | public enum MediaPlaybackAutoRepeatMode 7 | { 8 | /// 9 | /// No repeating. 10 | /// 11 | None = 0, 12 | 13 | /// 14 | /// Repeat the current track. 15 | /// 16 | Track = 1, 17 | 18 | /// 19 | /// Repeat the current list of tracks. 20 | /// 21 | List = 2 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Media/MediaPlaybackTrackChangeDirection.cs: -------------------------------------------------------------------------------- 1 | namespace ModernFlyouts.Core.Media 2 | { 3 | /// 4 | /// Specifies the direction in which a media playback's track change. 5 | /// 6 | public enum MediaPlaybackTrackChangeDirection 7 | { 8 | /// 9 | /// The change direction is unknown. 10 | /// 11 | Unknown = 0, 12 | 13 | /// 14 | /// The change direction is forward. 15 | /// 16 | Forward = 1, 17 | 18 | /// 19 | /// The change direction is backward. 20 | /// 21 | Backward = 2 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Media/MediaPlaybackType.cs: -------------------------------------------------------------------------------- 1 | namespace ModernFlyouts.Core.Media 2 | { 3 | /// 4 | /// Defines values for the types of media playback. 5 | /// 6 | public enum MediaPlaybackType 7 | { 8 | /// 9 | /// The media type is unknown. 10 | /// 11 | Unknown = 0, 12 | 13 | /// 14 | /// The media type is audio music. 15 | /// 16 | Music = 1, 17 | 18 | /// 19 | /// The media type is video. 20 | /// 21 | Video = 2, 22 | 23 | /// 24 | /// The media type is an image. 25 | /// 26 | Image = 3 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/ModernFlyouts.Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0-windows10.0.19041.0 5 | x86;x64;arm64 6 | win10-x64;win10-x86;win10-arm64 7 | true 8 | preview 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo( 4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 5 | //(used if a resource is not found in the page, 6 | // or application resource dictionaries) 7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 8 | //(used if a resource is not found in the page, 9 | // app, or any theme specific resource dictionaries) 10 | )] 11 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Threading/DebounceDispatcher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Threading; 3 | 4 | namespace ModernFlyouts.Core.Threading 5 | { 6 | public class DebounceDispatcher 7 | { 8 | private DispatcherTimer timer; 9 | 10 | private Action _action; 11 | 12 | public DebounceDispatcher(DispatcherPriority priority = DispatcherPriority.ApplicationIdle, 13 | Dispatcher dispatcher = null) 14 | { 15 | if (dispatcher == null) 16 | dispatcher = Dispatcher.CurrentDispatcher; 17 | timer = new DispatcherTimer(priority, dispatcher); 18 | timer.Tick += Timer_Tick; 19 | } 20 | 21 | private void Timer_Tick(object sender, EventArgs e) 22 | { 23 | timer.Stop(); 24 | _action?.Invoke(); 25 | } 26 | 27 | public void Debounce(TimeSpan interval, Action action) 28 | { 29 | timer.Stop(); 30 | 31 | _action = action; 32 | 33 | timer.Interval = interval; 34 | 35 | timer.Start(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Threading/UiTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | using System.Threading.Tasks; 4 | using System.Windows; 5 | using System.Windows.Threading; 6 | 7 | namespace ModernFlyouts.Core.Threading 8 | { 9 | //Taken from here! 10 | //https://medium.com/criteo-engineering/switching-back-to-the-ui-thread-in-wpf-uwp-in-modern-c-5dc1cc8efa5e 11 | 12 | [AsyncMethodBuilder(typeof(UiTaskMethodBuilder))] 13 | public class UiTask 14 | { 15 | internal TaskCompletionSource Promise { get; } = new TaskCompletionSource(); 16 | 17 | public Task AsTask() => Promise.Task; 18 | 19 | public TaskAwaiter GetAwaiter() 20 | { 21 | return Promise.Task.GetAwaiter(); 22 | } 23 | 24 | public static implicit operator Task(UiTask task) => task.AsTask(); 25 | } 26 | 27 | public class UiTaskMethodBuilder 28 | { 29 | private readonly Dispatcher _dispatcher; 30 | 31 | public UiTaskMethodBuilder(Dispatcher dispatcher) 32 | { 33 | _dispatcher = dispatcher; 34 | } 35 | 36 | public void Start(ref TStateMachine stateMachine) 37 | where TStateMachine : IAsyncStateMachine 38 | { 39 | if (!_dispatcher.CheckAccess()) 40 | { 41 | _dispatcher.BeginInvoke(new Action(stateMachine.MoveNext)); 42 | } 43 | else 44 | { 45 | stateMachine.MoveNext(); 46 | } 47 | } 48 | 49 | public static UiTaskMethodBuilder Create() 50 | { 51 | return new UiTaskMethodBuilder(Application.Current.Dispatcher); 52 | } 53 | 54 | public void SetStateMachine(IAsyncStateMachine stateMachine) 55 | { 56 | } 57 | 58 | public void SetResult() 59 | { 60 | Task.Promise.SetResult(null); 61 | } 62 | 63 | public void SetException(Exception exception) 64 | { 65 | Task.Promise.SetException(exception); 66 | } 67 | 68 | public UiTask Task { get; } = new UiTask(); 69 | 70 | public void AwaitOnCompleted( 71 | ref TAwaiter awaiter, 72 | ref TStateMachine stateMachine) 73 | where TAwaiter : INotifyCompletion 74 | where TStateMachine : IAsyncStateMachine 75 | { 76 | awaiter.OnCompleted(ResumeAfterAwait(stateMachine)); 77 | } 78 | 79 | public void AwaitUnsafeOnCompleted( 80 | ref TAwaiter awaiter, 81 | ref TStateMachine stateMachine) 82 | where TAwaiter : ICriticalNotifyCompletion 83 | where TStateMachine : IAsyncStateMachine 84 | { 85 | awaiter.UnsafeOnCompleted(ResumeAfterAwait(stateMachine)); 86 | } 87 | 88 | private Action ResumeAfterAwait(TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine 89 | { 90 | return () => 91 | { 92 | if (!_dispatcher.CheckAccess()) 93 | { 94 | _dispatcher.BeginInvoke(new Action(stateMachine.MoveNext)); 95 | } 96 | else 97 | { 98 | stateMachine.MoveNext(); 99 | } 100 | }; 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/UI/FlyoutWindow/Enums.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ModernFlyouts.Core.UI 4 | { 5 | [Flags] 6 | public enum FlyoutWindowAlignments 7 | { 8 | Center = 0, 9 | Top = 1, 10 | Bottom = 2, 11 | Left = 4, 12 | Right = 8 13 | } 14 | 15 | public enum FlyoutWindowExpandDirection 16 | { 17 | Auto, 18 | Up, 19 | Down, 20 | Left, 21 | Right 22 | } 23 | 24 | public enum FlyoutWindowPlacementMode 25 | { 26 | Auto, 27 | Manual 28 | } 29 | 30 | public enum FlyoutWindowType 31 | { 32 | OnScreen, 33 | Tray 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/UI/FlyoutWindow/FlyoutWindow.Events.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace ModernFlyouts.Core.UI 4 | { 5 | public partial class FlyoutWindow 6 | { 7 | public static readonly RoutedEvent OpenedEvent = EventManager.RegisterRoutedEvent( 8 | nameof(Opened), 9 | RoutingStrategy.Direct, 10 | typeof(RoutedEventHandler), 11 | typeof(FlyoutWindow)); 12 | 13 | public event RoutedEventHandler Opened 14 | { 15 | add { AddHandler(OpenedEvent, value); } 16 | remove { RemoveHandler(OpenedEvent, value); } 17 | } 18 | 19 | public static readonly RoutedEvent ClosedEvent = EventManager.RegisterRoutedEvent( 20 | nameof(Closed), 21 | RoutingStrategy.Direct, 22 | typeof(RoutedEventHandler), 23 | typeof(FlyoutWindow)); 24 | 25 | public event RoutedEventHandler Closed 26 | { 27 | add { AddHandler(ClosedEvent, value); } 28 | remove { RemoveHandler(ClosedEvent, value); } 29 | } 30 | 31 | public static readonly RoutedEvent ClosingEvent = EventManager.RegisterRoutedEvent( 32 | nameof(Closing), 33 | RoutingStrategy.Direct, 34 | typeof(RoutedEventHandler), 35 | typeof(FlyoutWindow)); 36 | 37 | public event RoutedEventHandler Closing 38 | { 39 | add { AddHandler(ClosingEvent, value); } 40 | remove { RemoveHandler(ClosingEvent, value); } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/UI/FlyoutWindow/FlyoutWindow.Tray.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Core.Interop; 2 | 3 | namespace ModernFlyouts.Core.UI 4 | { 5 | public partial class FlyoutWindow 6 | { 7 | private void PositionTrayFlyout(ref double x, ref double y, double width, double height) 8 | { 9 | var taskbar = WindowsTaskbar.Current; 10 | var tbBounds = taskbar.Bounds; 11 | 12 | //var maxHeight = taskbar.ContainingScreen.WorkingArea.Height; 13 | //if (taskbar.IsAutoHideEnabled && (taskbar.Location == WindowsTaskbar.Position.Top || taskbar.Location == WindowsTaskbar.Position.Bottom)) 14 | //{ 15 | // maxHeight -= tbBounds.Height; 16 | //} 17 | 18 | switch (taskbar.Location) 19 | { 20 | case WindowsTaskbar.Position.Left: 21 | x = tbBounds.Right + effectiveMarginLeft; 22 | y = tbBounds.Bottom - height - effectiveMarginBottom; 23 | break; 24 | 25 | case WindowsTaskbar.Position.Right: 26 | x = tbBounds.Left - width - effectiveMarginRight; 27 | y = tbBounds.Bottom - height - effectiveMarginBottom; 28 | break; 29 | 30 | case WindowsTaskbar.Position.Top: 31 | x = taskbar.IsRightToLeftLayout ? 32 | tbBounds.Left + effectiveMarginLeft : tbBounds.Right - width - effectiveMarginRight; 33 | y = tbBounds.Bottom + effectiveMarginTop; 34 | break; 35 | 36 | case WindowsTaskbar.Position.Bottom: 37 | x = taskbar.IsRightToLeftLayout ? 38 | tbBounds.Left + effectiveMarginLeft : tbBounds.Right - width - effectiveMarginRight; 39 | y = tbBounds.Top - height - effectiveMarginBottom; 40 | break; 41 | } 42 | } 43 | 44 | private FlyoutWindowExpandDirection CalculateActualExpandDirectionTray() 45 | { 46 | var taskbar = WindowsTaskbar.Current; 47 | 48 | return taskbar.Location switch 49 | { 50 | WindowsTaskbar.Position.Left => FlyoutWindowExpandDirection.Right, 51 | WindowsTaskbar.Position.Top => FlyoutWindowExpandDirection.Down, 52 | WindowsTaskbar.Position.Right => FlyoutWindowExpandDirection.Left, 53 | WindowsTaskbar.Position.Bottom => FlyoutWindowExpandDirection.Up, 54 | _ => throw new System.NotImplementedException(), 55 | }; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Utilities/AirplaneModeWatcher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Management; 4 | 5 | namespace ModernFlyouts.Core.Utilities 6 | { 7 | public class AirplaneModeWatcher 8 | { 9 | private readonly ManagementEventWatcher watcher; 10 | 11 | public event EventHandler Changed; 12 | 13 | public AirplaneModeWatcher() 14 | { 15 | try 16 | { 17 | WqlEventQuery query = new( 18 | "SELECT * FROM RegistryValueChangeEvent WHERE " + 19 | "Hive = 'HKEY_LOCAL_MACHINE'" + 20 | @"AND KeyPath = 'SYSTEM\\CurrentControlSet\\Control\\RadioManagement\\SystemRadioState' AND ValueName=''"); 21 | 22 | watcher = new ManagementEventWatcher(query); 23 | watcher.EventArrived += new EventArrivedEventHandler(HandleEvent); 24 | } 25 | catch (ManagementException managementException) 26 | { 27 | Debug.WriteLine($"{nameof(AirplaneModeWatcher)}: " + managementException.Message); 28 | } 29 | } 30 | 31 | public void Start() 32 | { 33 | watcher.Start(); 34 | } 35 | 36 | public void Stop() 37 | { 38 | watcher.Stop(); 39 | } 40 | 41 | public static bool GetIsAirplaneModeEnabled() 42 | { 43 | var regkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\RadioManagement\SystemRadioState", false); 44 | return (int)regkey?.GetValue("", 1) == 1; 45 | } 46 | 47 | private void HandleEvent(object sender, EventArrivedEventArgs e) 48 | { 49 | Changed?.Invoke(this, new AirplaneModeChangedEventArgs(GetIsAirplaneModeEnabled())); 50 | } 51 | } 52 | 53 | public class AirplaneModeChangedEventArgs : EventArgs 54 | { 55 | public AirplaneModeChangedEventArgs(bool isEnabled) 56 | { 57 | IsEnabled = isEnabled; 58 | } 59 | 60 | public bool IsEnabled { get; } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Utilities/AudioDeviceNotificationClient.cs: -------------------------------------------------------------------------------- 1 | using NAudio.CoreAudioApi; 2 | using NAudio.CoreAudioApi.Interfaces; 3 | using System; 4 | 5 | namespace ModernFlyouts.Core.Utilities 6 | { 7 | public class AudioDeviceNotificationClient : IMMNotificationClient 8 | { 9 | public event EventHandler DefaultDeviceChanged; 10 | 11 | public void OnDefaultDeviceChanged(DataFlow dataFlow, Role deviceRole, string defaultDeviceId) 12 | { 13 | if (dataFlow == DataFlow.Render && deviceRole == Role.Multimedia) 14 | { 15 | DefaultDeviceChanged?.Invoke(this, defaultDeviceId); 16 | } 17 | } 18 | 19 | public void OnDeviceAdded(string deviceId) 20 | { } 21 | 22 | public void OnDeviceRemoved(string deviceId) 23 | { } 24 | 25 | public void OnDeviceStateChanged(string deviceId, DeviceState newState) 26 | { } 27 | 28 | public void OnPropertyValueChanged(string deviceId, PropertyKey propertyKey) 29 | { } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Utilities/BrightnessWatcher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Management; 4 | 5 | namespace ModernFlyouts.Core.Utilities 6 | { 7 | public class BrightnessWatcher 8 | { 9 | private readonly ManagementEventWatcher watcher; 10 | 11 | public event EventHandler Changed; 12 | 13 | public BrightnessWatcher() 14 | { 15 | try 16 | { 17 | var scope = new ManagementScope("root\\WMI"); 18 | var query = new WqlEventQuery("SELECT * FROM WmiMonitorBrightnessEvent"); 19 | watcher = new ManagementEventWatcher(scope, query); 20 | watcher.EventArrived += new EventArrivedEventHandler(HandleEvent); 21 | } 22 | catch (ManagementException managementException) 23 | { 24 | Debug.WriteLine($"{nameof(BrightnessWatcher)}: " + managementException.Message); 25 | } 26 | } 27 | 28 | public void Start() 29 | { 30 | try 31 | { 32 | watcher.Start(); 33 | } 34 | catch (ManagementException managementException) 35 | { 36 | Debug.WriteLine($"{nameof(BrightnessWatcher)}: " + managementException.Message); 37 | } 38 | } 39 | 40 | public void Stop() 41 | { 42 | try 43 | { 44 | watcher.Stop(); 45 | } 46 | catch (ManagementException managementException) 47 | { 48 | Debug.WriteLine($"{nameof(BrightnessWatcher)}: " + managementException.Message); 49 | } 50 | } 51 | 52 | private void HandleEvent(object sender, EventArrivedEventArgs e) 53 | { 54 | int value = int.Parse(e.NewEvent.Properties["Brightness"].Value.ToString()); 55 | Changed?.Invoke(this, new BrightnessChangedEventArgs(value)); 56 | } 57 | } 58 | 59 | public class BrightnessChangedEventArgs : EventArgs 60 | { 61 | public BrightnessChangedEventArgs(int newValue) 62 | { 63 | NewValue = newValue; 64 | } 65 | 66 | public int NewValue { get; set; } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /ModernFlyouts.Core/Utilities/NpsmService.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Core.Interop; 2 | using System; 3 | 4 | namespace ModernFlyouts.Core.Utilities 5 | { 6 | public static class NpsmService 7 | { 8 | private static readonly ulong WNF_NPSM_SERVICE_STARTED = 0xC951E23A3BC0875; 9 | private static readonly ulong WNF_SHEL_SESSION_LOGON_COMPLETE = 0xD83063EA3BE3835; 10 | 11 | private static readonly object _subscriptionLock = new object(); 12 | private static IntPtr _subId; 13 | 14 | private static event EventHandler _started; 15 | 16 | //This prevents from being GC'd 17 | private static readonly Wnf.WnfUserCallback wnfSubHandler = new Wnf.WnfUserCallback(WnfSubHandler); 18 | 19 | private static IntPtr WnfSubHandler(ulong stateName, uint changeStamp, IntPtr typeId, IntPtr callbackContext, IntPtr bufferPtr, uint bufferSize) 20 | { 21 | _started?.Invoke(null, EventArgs.Empty); 22 | return IntPtr.Zero; 23 | } 24 | 25 | /// 26 | /// Occurs when the NPSM service is started or restarted 27 | /// Of course this runs on a different thread. 28 | /// 29 | public static event EventHandler Started 30 | { 31 | add 32 | { 33 | lock (_subscriptionLock) 34 | { 35 | if (_started == null) 36 | { 37 | var wnfData = Wnf.QueryWnf(WNF_SHEL_SESSION_LOGON_COMPLETE); 38 | Wnf.SubscribeWnf(WNF_SHEL_SESSION_LOGON_COMPLETE, wnfData.Changestamp, wnfSubHandler, out _subId); 39 | } 40 | 41 | _started += value; 42 | } 43 | } 44 | remove 45 | { 46 | lock (_subscriptionLock) 47 | { 48 | _started -= value; 49 | 50 | if (_started == null) 51 | { 52 | Wnf.UnsubscribeWnf(_subId); 53 | _subId = IntPtr.Zero; 54 | } 55 | } 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/LargeTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/LargeTile.scale-100.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/LargeTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/LargeTile.scale-125.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/LargeTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/LargeTile.scale-150.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/LargeTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/LargeTile.scale-200.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/LargeTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/LargeTile.scale-400.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/SmallTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/SmallTile.scale-100.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/SmallTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/SmallTile.scale-125.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/SmallTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/SmallTile.scale-150.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/SmallTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/SmallTile.scale-200.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/SmallTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/SmallTile.scale-400.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/SplashScreen.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/SplashScreen.scale-125.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/SplashScreen.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/SplashScreen.scale-150.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square150x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square150x150Logo.scale-125.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square150x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square150x150Logo.scale-150.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.altform-unplated_targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.altform-unplated_targetsize-32.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.scale-125.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.scale-150.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.targetsize-24.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.targetsize-32.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/StoreLogo.backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/StoreLogo.backup.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/StoreLogo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/StoreLogo.scale-125.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/StoreLogo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/StoreLogo.scale-150.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/StoreLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/StoreLogo.scale-200.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/StoreLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/StoreLogo.scale-400.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Wide310x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Wide310x150Logo.scale-125.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Wide310x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Wide310x150Logo.scale-150.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Images/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts.Package/Images/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /ModernFlyouts.Package/Package.appinstaller: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | true 18 | 19 | 20 | 21 | 22 | 23 | 27 | -------------------------------------------------------------------------------- /ModernFlyouts.Package/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 10 | 11 | 15 | 16 | 17 | ms-resource:Resources/PackageDisplayName 18 | ms-resource:Resources/PublisherDisplayName 19 | Images\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 62 | 68 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 83 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /ModernFlyouts.Package/priconfig.default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ModernFlyouts/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ModernFlyouts/App.xaml: -------------------------------------------------------------------------------- 1 |  12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 8 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /ModernFlyouts/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace ModernFlyouts 4 | { 5 | public partial class App : Application 6 | { 7 | public App() 8 | { 9 | InitializeComponent(); 10 | Startup += App_Startup; 11 | JumpListHelper.CreateJumpList(); 12 | } 13 | 14 | private void App_Startup(object sender, StartupEventArgs e) 15 | { 16 | FlyoutHandler.Instance = new FlyoutHandler(); 17 | FlyoutHandler.Instance.Initialize(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ModernFlyouts/AppLifecycle/AppDataMigration.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Helpers; 2 | using Windows.Storage; 3 | 4 | namespace ModernFlyouts.AppLifecycle 5 | { 6 | public class AppDataMigration 7 | { 8 | /// 9 | /// Migrates unused application data into their new alternatives if they exists. 10 | /// 11 | public static void Perform() 12 | { 13 | try 14 | { 15 | string topBarEnabled = "TopBarEnabled"; 16 | if (ApplicationData.Current.LocalSettings.Values.ContainsKey(topBarEnabled)) 17 | { 18 | AppDataHelper.TopBarVisibility = AppDataHelper.GetValue(true, topBarEnabled) ? UI.TopBarVisibility.Visible : UI.TopBarVisibility.AutoHide; 19 | ApplicationData.Current.LocalSettings.Values.Remove(topBarEnabled); 20 | } 21 | } 22 | catch { } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ModernFlyouts/AppLifecycle/RelaunchHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace ModernFlyouts.AppLifecycle 5 | { 6 | internal class RelaunchHelper 7 | { 8 | /// 9 | /// Registers the active instance of an application for restart. 10 | /// 11 | /// 12 | /// A pointer to a Unicode string that specifies the command-line arguments for the application when it is restarted. 13 | /// The maximum size of the command line that you can specify is RESTART_MAX_CMD_LINE characters. Do not include the name of the executable 14 | /// in the command line; this function adds it for you. 15 | /// If this parameter is NULL or an empty string, the previously registered command line is removed. If the argument contains spaces, 16 | /// use quotes around the argument. 17 | /// 18 | /// One of the options specified in RestartFlags 19 | /// 20 | /// This function returns S_OK on success or one of the following error codes: 21 | /// E_FAIL for internal error. 22 | /// E_INVALIDARG if the specified command line is too long. 23 | /// 24 | [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] 25 | internal static extern int RegisterApplicationRestart([MarshalAs(UnmanagedType.LPWStr)] string pwzCommandLine, RestartFlags dwFlags); 26 | 27 | [Flags] 28 | internal enum RestartFlags 29 | { 30 | /// None of the options below. 31 | NONE = 0, 32 | 33 | /// Do not restart the process if it terminates due to an unhandled exception. 34 | RESTART_NO_CRASH = 1, 35 | 36 | /// Do not restart the process if it terminates due to the application not responding. 37 | RESTART_NO_HANG = 2, 38 | 39 | /// Do not restart the process if it terminates due to the installation of an update. 40 | RESTART_NO_PATCH = 4, 41 | 42 | /// Do not restart the process if the computer is restarted as the result of an update. 43 | RESTART_NO_REBOOT = 8 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/DefaultAudioThumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/DefaultAudioThumbnail.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/DefaultImageThumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/DefaultImageThumbnail.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/DefaultVideoThumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/DefaultVideoThumbnail.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_1024.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_128.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_16.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_24.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_256.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_32.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_48.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_512.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_64.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_96.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_Black_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_Black_1024.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_Black_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_Black_16.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_White_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_White_1024.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_White_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_White_16.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_White_16_mod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_White_16_mod.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_White_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_White_24.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_White_30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_White_30.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_White_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_White_36.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_White_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_White_48.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/ModernFlyouts_White_96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/ModernFlyouts_White_96.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Images/Readme_Banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Images/Readme_Banner.png -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Logo.ico -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Logo_Tray_Black.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Logo_Tray_Black.ico -------------------------------------------------------------------------------- /ModernFlyouts/Assets/Logo_Tray_White.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manstheram/ModernFlyouts/e7528916561143914fecc2dc0a7510afc571e0f7/ModernFlyouts/Assets/Logo_Tray_White.ico -------------------------------------------------------------------------------- /ModernFlyouts/Behaviors/DragFlyoutBehavior.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Xaml.Behaviors; 2 | using ModernFlyouts.Core.UI; 3 | using System.Windows; 4 | 5 | namespace ModernFlyouts.Behaviors 6 | { 7 | public class DragFlyoutBehavior : Behavior 8 | { 9 | protected override void OnAttached() 10 | { 11 | base.OnAttached(); 12 | AssociatedObject.MouseLeftButtonDown += AssociatedObject_MouseLeftButtonDown; 13 | } 14 | 15 | protected override void OnDetaching() 16 | { 17 | base.OnDetaching(); 18 | AssociatedObject.MouseLeftButtonDown -= AssociatedObject_MouseLeftButtonDown; 19 | } 20 | 21 | private void AssociatedObject_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) 22 | { 23 | var flyoutWindow = FlyoutWindow.GetFlyoutWindow(AssociatedObject); 24 | if (flyoutWindow != null) 25 | { 26 | flyoutWindow.DragMove(); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ModernFlyouts/Controls/AirplaneModeControl.xaml: -------------------------------------------------------------------------------- 1 |  13 | 14 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /ModernFlyouts/Controls/AirplaneModeControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace ModernFlyouts.Controls 4 | { 5 | public partial class AirplaneModeControl : UserControl 6 | { 7 | public AirplaneModeControl() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ModernFlyouts/Controls/BrightnessControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace ModernFlyouts.Controls 4 | { 5 | public partial class BrightnessControl : UserControl 6 | { 7 | public BrightnessControl() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ModernFlyouts/Controls/DirectableStackPanel.cs: -------------------------------------------------------------------------------- 1 | using ModernWpf.Controls; 2 | using System; 3 | using System.Windows; 4 | using System.Windows.Controls; 5 | 6 | // Should this be moved to the ModernWpfCommunityToolkit so that it is available to everyone? 7 | namespace ModernFlyouts.Controls 8 | { 9 | public enum StackingDirection 10 | { 11 | Ascending, 12 | Descending 13 | } 14 | 15 | public class DirectableStackPanel : SimpleStackPanel 16 | { 17 | #region Properties 18 | 19 | #region Direction 20 | 21 | public static readonly DependencyProperty DirectionProperty = 22 | DependencyProperty.Register( 23 | nameof(Direction), 24 | typeof(StackingDirection), 25 | typeof(DirectableStackPanel), 26 | new FrameworkPropertyMetadata(StackingDirection.Ascending, FrameworkPropertyMetadataOptions.AffectsArrange)); 27 | 28 | public StackingDirection Direction 29 | { 30 | get => (StackingDirection)GetValue(DirectionProperty); 31 | set => SetValue(DirectionProperty, value); 32 | } 33 | 34 | #endregion 35 | 36 | #endregion 37 | 38 | protected override Size ArrangeOverride(Size arrangeSize) 39 | { 40 | UIElementCollection children = InternalChildren; 41 | bool fHorizontal = Orientation == Orientation.Horizontal; 42 | bool ascending = Direction == StackingDirection.Ascending; 43 | Rect rcChild = new(arrangeSize); 44 | double previousChildSize = 0.0; 45 | double spacing = Spacing; 46 | 47 | for (int i = 0, count = children.Count; i < count; i++) 48 | { 49 | var index = ascending ? i : count - 1 - i; 50 | 51 | UIElement child = children[index]; 52 | SetZIndex(child, i); 53 | 54 | if (child == null) { continue; } 55 | 56 | if (fHorizontal) 57 | { 58 | rcChild.X += previousChildSize; 59 | previousChildSize = child.DesiredSize.Width; 60 | rcChild.Width = previousChildSize; 61 | rcChild.Height = Math.Max(arrangeSize.Height, child.DesiredSize.Height); 62 | } 63 | else 64 | { 65 | rcChild.Y += previousChildSize; 66 | previousChildSize = child.DesiredSize.Height; 67 | rcChild.Height = previousChildSize; 68 | rcChild.Width = Math.Max(arrangeSize.Width, child.DesiredSize.Width); 69 | } 70 | 71 | if (child.Visibility != Visibility.Collapsed) 72 | { 73 | previousChildSize += spacing; 74 | } 75 | 76 | child.Arrange(rcChild); 77 | } 78 | 79 | return arrangeSize; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /ModernFlyouts/Controls/DisplayMonitorPicker.xaml.cs: -------------------------------------------------------------------------------- 1 | using CommunityToolkit.Mvvm.Input; 2 | using ModernFlyouts.Core.Display; 3 | using System.Windows; 4 | using System.Windows.Controls; 5 | using System.Windows.Input; 6 | 7 | namespace ModernFlyouts.Controls 8 | { 9 | public partial class DisplayMonitorPicker : UserControl 10 | { 11 | #region Properties 12 | 13 | #region PreferredDisplayMonitor 14 | 15 | public static readonly DependencyProperty PreferredDisplayMonitorProperty = 16 | DependencyProperty.Register( 17 | nameof(PreferredDisplayMonitor), 18 | typeof(DisplayMonitor), 19 | typeof(DisplayMonitorPicker), 20 | new PropertyMetadata()); 21 | 22 | public DisplayMonitor PreferredDisplayMonitor 23 | { 24 | get => (DisplayMonitor)GetValue(PreferredDisplayMonitorProperty); 25 | set => SetValue(PreferredDisplayMonitorProperty, value); 26 | } 27 | 28 | #endregion 29 | 30 | #region SetPreferredDisplayMonitorCommand 31 | 32 | public static readonly DependencyProperty SetPreferredDisplayMonitorCommandProperty = 33 | DependencyProperty.Register( 34 | nameof(SetPreferredDisplayMonitorCommand), 35 | typeof(ICommand), 36 | typeof(DisplayMonitorPicker), 37 | new PropertyMetadata()); 38 | 39 | public ICommand SetPreferredDisplayMonitorCommand 40 | { 41 | get => (ICommand)GetValue(SetPreferredDisplayMonitorCommandProperty); 42 | set => SetValue(SetPreferredDisplayMonitorCommandProperty, value); 43 | } 44 | 45 | #endregion 46 | 47 | #endregion 48 | 49 | public DisplayMonitorPicker() 50 | { 51 | InitializeComponent(); 52 | 53 | SetPreferredDisplayMonitorCommand = new RelayCommand(SetPreferredDisplayMonitor, x => true); 54 | } 55 | 56 | private void SetPreferredDisplayMonitor(DisplayMonitor displayMonitor) 57 | { 58 | PreferredDisplayMonitor = displayMonitor; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ModernFlyouts/Controls/LockKeysControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace ModernFlyouts.Controls 4 | { 5 | public partial class LockKeysControl : UserControl 6 | { 7 | public LockKeysControl() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ModernFlyouts/Controls/ScrollViewerEx.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Helpers; 2 | using System; 3 | using System.Windows; 4 | using System.Windows.Controls; 5 | using System.Windows.Input; 6 | 7 | namespace ModernFlyouts.Controls 8 | { 9 | public class ScrollViewerEx : ScrollViewer 10 | { 11 | protected override void OnInitialized(EventArgs e) 12 | { 13 | base.OnInitialized(e); 14 | 15 | if (Style == null && ReadLocalValue(StyleProperty) == DependencyProperty.UnsetValue) 16 | { 17 | SetResourceReference(StyleProperty, typeof(ScrollViewer)); 18 | } 19 | } 20 | 21 | protected override void OnMouseWheel(MouseWheelEventArgs e) 22 | { 23 | if (e.Handled) { return; } 24 | ScrollViewerHelperEx.OnMouseWheel(this, e); 25 | e.Handled = true; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ModernFlyouts/Controls/SessionsPanel.xaml: -------------------------------------------------------------------------------- 1 |  14 | 15 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ModernFlyouts/Controls/SessionsPanel.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace ModernFlyouts.Controls 4 | { 5 | public partial class SessionsPanel : UserControl 6 | { 7 | public SessionsPanel() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ModernFlyouts/Controls/VolumeControl.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 34 | 35 | 37 | 38 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /ModernFlyouts/Converters/DisplayMonitorIsCheckedConverter.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Core.Display; 2 | using System; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Windows; 6 | using System.Windows.Data; 7 | 8 | namespace ModernFlyouts.Converters 9 | { 10 | public class DisplayMonitorIsCheckedConverter : IMultiValueConverter 11 | { 12 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 13 | { 14 | if (values.Any(o => o == DependencyProperty.UnsetValue || o == null)) 15 | return null; 16 | 17 | DisplayMonitor value = values[0] as DisplayMonitor; 18 | DisplayMonitor preferredValue = values[1] as DisplayMonitor; 19 | 20 | return value == preferredValue; 21 | } 22 | 23 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 24 | { 25 | throw new NotImplementedException(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ModernFlyouts/Converters/DisplayMonitorPositionConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | using System.Windows; 5 | using System.Windows.Data; 6 | 7 | namespace ModernFlyouts.Converters 8 | { 9 | public class DisplayMonitorPositionConverter : IMultiValueConverter 10 | { 11 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 12 | { 13 | if (values.Any(o => o == DependencyProperty.UnsetValue || o == null)) 14 | return 0.0; 15 | 16 | double value = (double)values[0]; 17 | double absoluteValue = (double)values[1]; 18 | 19 | return value - absoluteValue; 20 | } 21 | 22 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ModernFlyouts/Converters/EnumToLocalizedStringConverter.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Helpers; 2 | using System; 3 | using System.Globalization; 4 | using System.Windows.Data; 5 | 6 | namespace ModernFlyouts.Converters 7 | { 8 | public class EnumToLocalizedStringConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | if (value is Enum @enum) 13 | { 14 | return LocalizationHelper.GetLocalisedEnumValue(@enum); 15 | } 16 | 17 | return string.Empty; 18 | } 19 | 20 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 21 | { 22 | throw new NotImplementedException(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ModernFlyouts/Converters/IndexToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace ModernFlyouts.Converters 7 | { 8 | public class IndexToVisibilityConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | int index = (int)value; 13 | int reqIndex = 0; 14 | 15 | if (parameter != null && int.TryParse(parameter.ToString(), out int result)) 16 | { 17 | reqIndex = result; 18 | } 19 | 20 | return index == reqIndex ? Visibility.Visible : Visibility.Collapsed; 21 | } 22 | 23 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 24 | { 25 | throw new NotImplementedException(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ModernFlyouts/Converters/InvertBooleanToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace ModernFlyouts.Converters 7 | { 8 | public class InvertBooleanToVisibilityConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | bool result = false; 13 | if (value is bool boolean) 14 | { 15 | result = boolean; 16 | } 17 | else if (value is bool?) 18 | { 19 | bool? nullable = (bool?)value; 20 | result = nullable.HasValue && nullable.Value; 21 | } 22 | 23 | return result ? Visibility.Collapsed : Visibility.Visible; 24 | } 25 | 26 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 27 | { 28 | throw new NotImplementedException(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ModernFlyouts/Converters/ScrollButtonVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | using System.Windows; 5 | using System.Windows.Data; 6 | 7 | namespace ModernFlyouts.Converters 8 | { 9 | public class ScrollButtonVisibilityConverter : IMultiValueConverter 10 | { 11 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 12 | { 13 | if (values.Any(o => o == DependencyProperty.UnsetValue || o == null)) return Visibility.Visible; 14 | var value = (double)values[0]; 15 | var req = (double)values[1]; 16 | var op = parameter.ToString(); 17 | 18 | return op switch 19 | { 20 | ">" => value > req ? Visibility.Visible : Visibility.Collapsed, 21 | "<" => value < req ? Visibility.Visible : Visibility.Collapsed, 22 | _ => Visibility.Visible, 23 | }; 24 | } 25 | 26 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 27 | { 28 | throw new NotImplementedException(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ModernFlyouts/Converters/TextToTooltipEnabledConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows.Data; 4 | 5 | namespace ModernFlyouts.Converters 6 | { 7 | public class TextToTooltipEnabledConverter : IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 10 | { 11 | var text = (string)value; 12 | return !string.IsNullOrEmpty(text) && !string.IsNullOrWhiteSpace(text); 13 | } 14 | 15 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ModernFlyouts/DesignTime/MockMediaSession.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Core.Media; 2 | using ModernFlyouts.Core.Media.Control; 3 | using ModernFlyouts.Helpers; 4 | using System; 5 | using System.Diagnostics; 6 | using System.Windows.Media.Imaging; 7 | 8 | namespace ModernFlyouts.DesignTime 9 | { 10 | internal class MockMediaSession : MediaSession 11 | { 12 | public MockMediaSession() 13 | { 14 | IsPlayEnabled = true; 15 | IsPauseEnabled = true; 16 | IsPlayOrPauseEnabled = true; 17 | IsPreviousEnabled = true; 18 | IsNextEnabled = true; 19 | IsShuffleEnabled = true; 20 | IsRepeatEnabled = true; 21 | IsStopEnabled = true; 22 | 23 | IsTimelinePropertiesEnabled = true; 24 | TimelineStartTime = TimeSpan.Zero; 25 | TimelineEndTime = TimeSpan.FromMinutes(3); 26 | PlaybackPosition = TimeSpan.FromMinutes(1.5); 27 | 28 | IsPlaying = false; 29 | IsShuffleActive = false; 30 | AutoRepeatMode = MediaPlaybackAutoRepeatMode.None; 31 | PlaybackType = MediaPlaybackType.Image; 32 | 33 | MediaSourceName = "TestApp"; 34 | MediaSourceIcon = new BitmapImage(PackUriHelper.GetAbsoluteUri("/Assets/Images/ModernFlyouts_16.png")); 35 | Thumbnail = AudioFlyoutHelper.GetDefaultImageThumbnail(); 36 | 37 | Title = "This is a lengthy title of a songggggggggggggggggggggggggg"; 38 | Artist = "Why not me?"; 39 | } 40 | 41 | protected override void ChangeAutoRepeatMode() 42 | { 43 | AutoRepeatMode = AutoRepeatMode switch 44 | { 45 | MediaPlaybackAutoRepeatMode.None => MediaPlaybackAutoRepeatMode.List, 46 | MediaPlaybackAutoRepeatMode.List => MediaPlaybackAutoRepeatMode.Track, 47 | MediaPlaybackAutoRepeatMode.Track => MediaPlaybackAutoRepeatMode.None, 48 | _ => throw new NotImplementedException() 49 | }; 50 | } 51 | 52 | protected override void ChangeShuffleActive() 53 | { 54 | IsShuffleActive = !IsShuffleActive; 55 | } 56 | 57 | protected override void NextTrack() 58 | { 59 | Debug.WriteLine(nameof(MockMediaSession) + ": Next track"); 60 | } 61 | 62 | protected override void Pause() 63 | { 64 | IsPlaying = false; 65 | } 66 | 67 | protected override void Play() 68 | { 69 | IsPlaying = true; 70 | } 71 | 72 | protected override void PlaybackPositionChanged(TimeSpan playbackPosition) 73 | { 74 | Debug.WriteLine(nameof(MockMediaSession) + ": Playback Position - " + PlaybackPosition.ToString("hh\\:mm\\:ss")); 75 | } 76 | 77 | protected override void PreviousTrack() 78 | { 79 | Debug.WriteLine(nameof(MockMediaSession) + ": Previous track"); 80 | } 81 | 82 | protected override void Stop() 83 | { 84 | IsPlaying = false; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /ModernFlyouts/Flyout Helpers/AirplaneModeFlyoutHelper.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Controls; 2 | using ModernFlyouts.Helpers; 3 | 4 | namespace ModernFlyouts 5 | { 6 | public class AirplaneModeFlyoutHelper : FlyoutHelperBase 7 | { 8 | private AirplaneModeControl airplaneModeControl; 9 | 10 | #region Properties 11 | 12 | private bool airplaneMode; 13 | 14 | public bool AirplaneMode 15 | { 16 | get => airplaneMode; 17 | private set => SetProperty(ref airplaneMode, value); 18 | } 19 | 20 | #endregion 21 | 22 | public AirplaneModeFlyoutHelper() 23 | { 24 | Initialize(); 25 | } 26 | 27 | public void Initialize() 28 | { 29 | AlwaysHandleDefaultFlyout = true; 30 | 31 | airplaneModeControl = new AirplaneModeControl(); 32 | 33 | PrimaryContent = airplaneModeControl; 34 | 35 | OnEnabled(); 36 | } 37 | 38 | public override bool CanHandleNativeOnScreenFlyout(FlyoutTriggerData triggerData) 39 | { 40 | if (triggerData.TriggerType == FlyoutTriggerType.AirplaneMode) 41 | { 42 | AirplaneMode = triggerData.Data is bool isEnabled && isEnabled; 43 | return true; 44 | } 45 | 46 | return base.CanHandleNativeOnScreenFlyout(triggerData); 47 | } 48 | 49 | protected override void OnEnabled() 50 | { 51 | base.OnEnabled(); 52 | 53 | AppDataHelper.AirplaneModeModuleEnabled = IsEnabled; 54 | } 55 | 56 | protected override void OnDisabled() 57 | { 58 | base.OnDisabled(); 59 | 60 | AppDataHelper.AirplaneModeModuleEnabled = IsEnabled; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /ModernFlyouts/Flyout Helpers/BrightnessFlyoutHelper.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Controls; 2 | using ModernFlyouts.Core.Display; 3 | using ModernFlyouts.Helpers; 4 | 5 | namespace ModernFlyouts 6 | { 7 | public class BrightnessFlyoutHelper : FlyoutHelperBase 8 | { 9 | private BrightnessControl brightnessControl; 10 | 11 | private bool compatibilityMode = false; 12 | public bool CompatibilityMode 13 | { 14 | get { return compatibilityMode; } 15 | set { CompatibilityChanged(value); } 16 | } 17 | 18 | public BrightnessFlyoutHelper() 19 | { 20 | Initialize(); 21 | } 22 | 23 | public void Initialize() 24 | { 25 | AlwaysHandleDefaultFlyout = true; 26 | 27 | BrightnessManager.Initialize(compatibilityMode); 28 | 29 | brightnessControl = new BrightnessControl(); 30 | 31 | PrimaryContent = brightnessControl; 32 | 33 | OnEnabled(); 34 | } 35 | 36 | public override bool CanHandleNativeOnScreenFlyout(FlyoutTriggerData triggerData) 37 | { 38 | if (triggerData.TriggerType == FlyoutTriggerType.Brightness) 39 | return true; 40 | 41 | return base.CanHandleNativeOnScreenFlyout(triggerData); 42 | } 43 | 44 | protected override void OnEnabled() 45 | { 46 | base.OnEnabled(); 47 | 48 | AppDataHelper.BrightnessModuleEnabled = IsEnabled; 49 | 50 | BrightnessManager.Initialize(compatibilityMode); 51 | } 52 | 53 | protected override void OnDisabled() 54 | { 55 | base.OnDisabled(); 56 | 57 | BrightnessManager.Suspend(); 58 | 59 | AppDataHelper.BrightnessModuleEnabled = IsEnabled; 60 | } 61 | 62 | public void CompatibilityChanged(bool mode) 63 | { 64 | compatibilityMode = mode; 65 | BrightnessManager.Instance.CompatibilityMode = compatibilityMode; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /ModernFlyouts/Flyout Helpers/FlyoutHelperBase.cs: -------------------------------------------------------------------------------- 1 | using CommunityToolkit.Mvvm.ComponentModel; 2 | using System.Windows; 3 | 4 | namespace ModernFlyouts 5 | { 6 | public abstract class FlyoutHelperBase : ObservableObject 7 | { 8 | public event ShowFlyoutEventHandler ShowFlyoutRequested; 9 | 10 | public delegate void ShowFlyoutEventHandler(FlyoutHelperBase sender); 11 | 12 | #region Properties 13 | 14 | private FrameworkElement primaryContent; 15 | 16 | public FrameworkElement PrimaryContent 17 | { 18 | get => primaryContent; 19 | set => SetProperty(ref primaryContent, value); 20 | } 21 | 22 | private FrameworkElement secondaryContent; 23 | 24 | public FrameworkElement SecondaryContent 25 | { 26 | get => secondaryContent; 27 | set => SetProperty(ref secondaryContent, value); 28 | } 29 | 30 | private bool primaryContentVisible = true; 31 | 32 | public bool PrimaryContentVisible 33 | { 34 | get => primaryContentVisible; 35 | set => SetProperty(ref primaryContentVisible, value); 36 | } 37 | 38 | private bool secondaryContentVisible; 39 | 40 | public bool SecondaryContentVisible 41 | { 42 | get => secondaryContentVisible; 43 | set => SetProperty(ref secondaryContentVisible, value); 44 | } 45 | 46 | public bool AlwaysHandleDefaultFlyout { get; protected set; } 47 | 48 | private bool isEnabled = true; 49 | 50 | public bool IsEnabled 51 | { 52 | get => isEnabled; 53 | set 54 | { 55 | if (SetProperty(ref isEnabled, value)) 56 | { 57 | OnIsEnabledChanged(); 58 | } 59 | } 60 | } 61 | 62 | #endregion 63 | 64 | private void OnIsEnabledChanged() 65 | { 66 | if (isEnabled) 67 | { 68 | OnEnabled(); 69 | } 70 | else 71 | { 72 | OnDisabled(); 73 | } 74 | } 75 | 76 | protected virtual void OnEnabled() 77 | { 78 | } 79 | 80 | protected virtual void OnDisabled() 81 | { 82 | if (FlyoutHandler.Instance.OnScreenFlyoutView.FlyoutHelper == this) 83 | { 84 | FlyoutHandler.Instance.OnScreenFlyoutWindow.IsOpen = false; 85 | } 86 | } 87 | 88 | public virtual bool CanHandleNativeOnScreenFlyout(FlyoutTriggerData triggerData) 89 | { 90 | return false; 91 | } 92 | 93 | protected void RequestShowFlyout() 94 | { 95 | ShowFlyoutRequested?.Invoke(this); 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /ModernFlyouts/Flyout Helpers/FlyoutTriggerData.cs: -------------------------------------------------------------------------------- 1 | namespace ModernFlyouts 2 | { 3 | public enum FlyoutTriggerType 4 | { 5 | Volume, 6 | Media, 7 | AirplaneMode, 8 | Brightness 9 | } 10 | 11 | public class FlyoutTriggerData 12 | { 13 | public FlyoutTriggerType TriggerType { get; set; } 14 | 15 | public object Data { get; set; } 16 | 17 | public bool IsExpired; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ModernFlyouts/Helpers/DefaultValuesStore.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Controls; 2 | using ModernFlyouts.Core.UI; 3 | using ModernFlyouts.UI; 4 | using ModernFlyouts.UI.Media; 5 | using ModernWpf; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | 9 | namespace ModernFlyouts.Helpers 10 | { 11 | internal class DefaultValuesStore 12 | { 13 | #region General 14 | 15 | public const bool AudioModuleEnabled = true; 16 | 17 | public const bool BrightnessModuleEnabled = true; 18 | 19 | public const bool AirplaneModeModuleEnabled = true; 20 | 21 | public const bool LockKeysModuleEnabled = true; 22 | 23 | public const DefaultFlyout PreferredDefaultFlyout = DefaultFlyout.ModernFlyouts; 24 | 25 | public static BindablePoint DefaultFlyoutPosition => new(50, 60); 26 | 27 | #endregion 28 | 29 | #region Layout 30 | 31 | public const FlyoutWindowPlacementMode OnScreenFlyoutWindowPlacementMode = FlyoutWindowPlacementMode.Auto; 32 | 33 | public const FlyoutWindowAlignments OnScreenFlyoutWindowAlignment = FlyoutWindowAlignments.Top | FlyoutWindowAlignments.Left; 34 | 35 | public static Thickness OnScreenFlyoutWindowMargin = new(10); 36 | 37 | public const FlyoutWindowExpandDirection OnScreenFlyoutWindowExpandDirection = FlyoutWindowExpandDirection.Auto; 38 | 39 | public const StackingDirection OnScreenFlyoutContentStackingDirection = StackingDirection.Ascending; 40 | 41 | public const Orientation FlyoutOrientation = Orientation.Horizontal; 42 | 43 | public const bool UseSmallFlyout = false; 44 | 45 | #endregion 46 | 47 | #region Module specific 48 | 49 | #region Audio module related 50 | 51 | public const bool ShowGSMTCInVolumeFlyout = true; 52 | 53 | public const bool ShowVolumeControlInGSMTCFlyout = true; 54 | 55 | #endregion 56 | 57 | #region Lock keys module related 58 | 59 | public const bool LockKeysModule_CapsLockEnabled = true; 60 | 61 | public const bool LockKeysModule_NumLockEnabled = true; 62 | 63 | public const bool LockKeysModule_ScrollLockEnabled = true; 64 | 65 | public const bool LockKeysModule_InsertEnabled = true; 66 | 67 | #endregion 68 | 69 | #region Brightness module related 70 | 71 | public const bool BrightnessCompatibility = false; 72 | 73 | #endregion 74 | 75 | #endregion 76 | 77 | #region UI 78 | 79 | public const TopBarVisibility DefaultTopBarVisibility = TopBarVisibility.Visible; 80 | 81 | public const ElementTheme AppTheme = ElementTheme.Default; 82 | 83 | public const ElementTheme FlyoutTheme = ElementTheme.Default; 84 | 85 | public const int FlyoutTimeout = 2750; 86 | 87 | public static string RecommendedFlyoutTimeout = FlyoutTimeout.ToString(); 88 | 89 | public const double FlyoutBackgroundOpacity = 100.0; 90 | 91 | public const bool TrayIconEnabled = true; 92 | 93 | public const bool UseColoredTrayIcon = true; 94 | 95 | public const bool FlyoutAnimationEnabled = true; 96 | 97 | public const bool AlignGSMTCThumbnailToRight = true; 98 | 99 | public const bool UseGSMTCThumbnailAsBackground = true; 100 | 101 | public const int MaxVerticalSessionControlsCount = 1; 102 | 103 | public const Orientation SessionsPanelOrientation = Orientation.Horizontal; 104 | 105 | #endregion 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /ModernFlyouts/Helpers/PackUriHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ModernFlyouts.Helpers 4 | { 5 | internal static class PackUriHelper 6 | { 7 | public static Uri GetAbsoluteUri(string path) 8 | { 9 | return new Uri($"pack://application:,,,/ModernFlyouts;component/{path}"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ModernFlyouts/Helpers/StartupHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Windows.ApplicationModel; 4 | 5 | namespace ModernFlyouts.Helpers 6 | { 7 | internal class StartupHelper 8 | { 9 | private const string StartupId = "ModernFlyoutsStartupId"; 10 | 11 | public static async Task GetRunAtStartupEnabled() 12 | { 13 | try 14 | { 15 | StartupTask startupTask = await StartupTask.GetAsync(StartupId); 16 | 17 | return startupTask.State == StartupTaskState.Enabled; 18 | } 19 | catch { return true; } 20 | } 21 | 22 | public static async void SetRunAtStartupEnabled(bool value) 23 | { 24 | try 25 | { 26 | StartupTask startupTask = await StartupTask.GetAsync(StartupId); 27 | 28 | if (value) 29 | { 30 | await startupTask.RequestEnableAsync(); 31 | } 32 | else 33 | { 34 | startupTask.Disable(); 35 | } 36 | } 37 | catch { } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ModernFlyouts/Helpers/WindowPlacementHelper.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Core.Interop; 2 | using System; 3 | using System.IO; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Xml; 7 | using System.Xml.Serialization; 8 | using static ModernFlyouts.Core.Interop.NativeMethods; 9 | 10 | namespace ModernFlyouts.Helpers 11 | { 12 | public static class WindowPlacementHelper 13 | { 14 | private static readonly Encoding encoding = new UTF8Encoding(); 15 | private static readonly XmlSerializer serializer = new(typeof(WINDOWPLACEMENT)); 16 | 17 | public static void SetPlacement(IntPtr windowHandle, string placementXml) 18 | { 19 | if (string.IsNullOrEmpty(placementXml)) 20 | { 21 | return; 22 | } 23 | 24 | WINDOWPLACEMENT placement; 25 | byte[] xmlBytes = encoding.GetBytes(placementXml); 26 | 27 | try 28 | { 29 | using (MemoryStream memoryStream = new(xmlBytes)) 30 | { 31 | placement = (WINDOWPLACEMENT)serializer.Deserialize(memoryStream); 32 | } 33 | 34 | placement.Length = Marshal.SizeOf(typeof(WINDOWPLACEMENT)); 35 | placement.Flags = 0; 36 | placement.ShowCmd = placement.ShowCmd == ShowWindowCommands.ShowMinimized ? ShowWindowCommands.Normal : placement.ShowCmd; 37 | SetWindowPlacement(windowHandle, ref placement); 38 | } 39 | catch (InvalidOperationException) 40 | { 41 | // Parsing placement XML failed. Fail silently. 42 | } 43 | } 44 | 45 | public static string GetPlacement(IntPtr windowHandle) 46 | { 47 | WINDOWPLACEMENT placement = new(); 48 | GetWindowPlacement(windowHandle, out placement); 49 | 50 | using MemoryStream memoryStream = new(); 51 | using XmlTextWriter xmlTextWriter = new(memoryStream, Encoding.UTF8); 52 | serializer.Serialize(xmlTextWriter, placement); 53 | byte[] xmlBytes = memoryStream.ToArray(); 54 | return encoding.GetString(xmlBytes); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ModernFlyouts/Input/TappedEventHandler.cs: -------------------------------------------------------------------------------- 1 | namespace ModernFlyouts.Input 2 | { 3 | internal delegate void TappedEventHandler(object sender, TappedRoutedEventArgs e); 4 | } 5 | -------------------------------------------------------------------------------- /ModernFlyouts/Input/TappedRoutedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace ModernFlyouts.Input 4 | { 5 | internal sealed class TappedRoutedEventArgs : RoutedEventArgs 6 | { 7 | public TappedRoutedEventArgs() 8 | { 9 | } 10 | 11 | internal int Timestamp { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ModernFlyouts/Interop/ShellMessageHookHandler.cs: -------------------------------------------------------------------------------- 1 | using ModernFlyouts.Core.Interop; 2 | using System; 3 | using static ModernFlyouts.Core.Interop.NativeMethods; 4 | 5 | namespace ModernFlyouts.Interop 6 | { 7 | public class ShellMessageHookHandler : IWndProcHookHandler 8 | { 9 | private enum HookMessageEnum : uint 10 | { 11 | HOOK_MEDIA_PLAYPAUSE = 917504, 12 | HOOK_MEDIA_PREVIOUS = 786432, 13 | HOOK_MEDIA_NEXT = 720896, 14 | HOOK_MEDIA_STOP = 851968, 15 | HOOK_MEDIA_VOLPLUS = 655360, 16 | HOOK_MEDIA_VOLMINUS = 589824, 17 | HOOK_MEDIA_VOLMUTE = 524288 18 | } 19 | 20 | private uint messageShellHookId; 21 | 22 | public ShellMessageHookHandler() 23 | { 24 | } 25 | 26 | public uint OnHwndCreated(IntPtr hWnd, out bool register) 27 | { 28 | RegisterShellHookWindow(hWnd); 29 | messageShellHookId = RegisterWindowMessage("SHELLHOOK"); 30 | 31 | register = true; 32 | 33 | return messageShellHookId; 34 | } 35 | 36 | public IntPtr OnWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam) 37 | { 38 | FlyoutTriggerData triggerData = new(); 39 | 40 | void TriggerFlyout() 41 | { 42 | FlyoutHandler.Instance.ProcessFlyoutTrigger(triggerData); 43 | } 44 | 45 | if (msg == messageShellHookId) 46 | { 47 | if (wParam == (IntPtr)55) 48 | { 49 | //Brightness 50 | triggerData.TriggerType = FlyoutTriggerType.Brightness; 51 | TriggerFlyout(); 52 | } 53 | else if (wParam == (IntPtr)12) 54 | { 55 | switch ((long)lParam) 56 | { 57 | case (long)HookMessageEnum.HOOK_MEDIA_NEXT: 58 | case (long)HookMessageEnum.HOOK_MEDIA_PREVIOUS: 59 | case (long)HookMessageEnum.HOOK_MEDIA_PLAYPAUSE: 60 | case (long)HookMessageEnum.HOOK_MEDIA_STOP: 61 | //Media 62 | triggerData.TriggerType = FlyoutTriggerType.Media; 63 | TriggerFlyout(); 64 | break; 65 | 66 | case (long)HookMessageEnum.HOOK_MEDIA_VOLMINUS: 67 | case (long)HookMessageEnum.HOOK_MEDIA_VOLMUTE: 68 | case (long)HookMessageEnum.HOOK_MEDIA_VOLPLUS: 69 | //Volume 70 | triggerData.TriggerType = FlyoutTriggerType.Volume; 71 | TriggerFlyout(); 72 | break; 73 | 74 | default: 75 | //Ignore mouse side buttons and other keyboard special keys 76 | break; 77 | } 78 | } 79 | } 80 | 81 | return IntPtr.Zero; 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /ModernFlyouts/JumpListHelper.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Windows.Shell; 3 | 4 | namespace ModernFlyouts 5 | { 6 | public class JumpListHelper 7 | { 8 | public static string AppPath { get; set; } = string.Empty; 9 | 10 | internal const string arg_settings = "/settings"; 11 | internal const string arg_exit = "/exit-safe"; 12 | internal const string arg_restore = "/restore"; 13 | internal const string arg_appupdated = "/app-restarted-after-update"; 14 | internal const char arg_delimiter = ' '; 15 | 16 | public static void CreateJumpList() 17 | { 18 | AppPath = Path.Combine(Directory.GetCurrentDirectory(), $"{Program.AppHostName}.exe"); 19 | 20 | JumpList jumpList = new(); 21 | JumpTask settingsTask = new() 22 | { 23 | Title = Properties.Strings.SettingsItem, 24 | Description = Properties.Strings.SettingsItemDescription, 25 | ApplicationPath = AppPath, 26 | Arguments = arg_settings, 27 | IconResourceIndex = -1 28 | }; 29 | jumpList.JumpItems.Add(settingsTask); 30 | 31 | JumpTask restoreTask = new() 32 | { 33 | Title = Properties.Strings.RestoreDefaultItem, 34 | Description = Properties.Strings.RestoreDefaultItemDescription, 35 | ApplicationPath = AppPath, 36 | Arguments = arg_restore, 37 | IconResourceIndex = -1, 38 | }; 39 | jumpList.JumpItems.Add(restoreTask); 40 | 41 | JumpTask exitTask = new() 42 | { 43 | Title = Properties.Strings.ExitItem, 44 | Description = Properties.Strings.ExitItemDescription, 45 | ApplicationPath = AppPath, 46 | Arguments = arg_exit, 47 | IconResourceIndex = -1 48 | }; 49 | jumpList.JumpItems.Add(exitTask); 50 | 51 | jumpList.Apply(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /ModernFlyouts/Navigation/AboutPage.xaml: -------------------------------------------------------------------------------- 1 |  12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 29 | 31 | 33 |