├── .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