<MenuFlyout
    x:Class="Ryujinx.Ava.UI.Controls.ApplicationContextMenu"
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
    xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
    x:DataType="viewModels:MainWindowViewModel">
    <MenuItem
        Command="{Binding RunApplication}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuRunApplication}"
        Icon="{ext:Icon fa-solid fa-play}"/>
    <MenuItem
        Command="{Binding ToggleFavorite}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuToggleFavorite}"
        Icon="{ext:Icon fa-solid fa-star}"
        ToolTip.Tip="{ext:Locale GameListContextMenuToggleFavoriteToolTip}" />
    <MenuItem
        Command="{Binding CreateApplicationShortcut}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuCreateShortcut}"
        Icon="{ext:Icon fa-solid fa-bookmark}"
        ToolTip.Tip="{OnPlatform Default={ext:Locale GameListContextMenuCreateShortcutToolTip}, macOS={ext:Locale GameListContextMenuCreateShortcutToolTipMacOS}}" />
    <MenuItem
        Command="{Binding EditGameConfiguration}"
        CommandParameter="{Binding}"
        IsVisible="{Binding SelectedApplication.HasIndependentConfiguration}"
        Header="{ext:Locale GameListContextMenuEditCustomConfiguration}"
        Icon="{ext:Icon fa-solid fa-gear}"
        ToolTip.Tip="{ext:Locale EditCustomConfigurationToolTip}" />
    <MenuItem
        Command="{Binding EditGameConfiguration}"
       CommandParameter="{Binding}"
       IsVisible="{Binding !SelectedApplication.HasIndependentConfiguration}"
       Header="{ext:Locale GameListContextMenuCreateCustomConfiguration}"
       Icon="{ext:Icon fa-solid fa-gear}"
       ToolTip.Tip="{ext:Locale CreateCustomConfigurationToolTip}" />
    <MenuItem
        IsVisible="{Binding HasCompatibilityEntry}"
        Command="{Binding OpenApplicationCompatibility}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuShowCompatEntry}"
        Icon="{ext:Icon mdi-gamepad}"
        ToolTip.Tip="{ext:Locale GameListContextMenuShowCompatEntryToolTip}"/>
    <MenuItem
        Command="{Binding OpenApplicationData}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuShowGameData}"
        Icon="{ext:Icon mdi-chart-line}"
        ToolTip.Tip="{ext:Locale GameListContextMenuShowGameDataToolTip}"/>
    <Separator />
    <MenuItem
        Command="{Binding OpenUserSaveDirectory}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuOpenUserSaveDirectory}"
        Icon="{ext:Icon mdi-folder-account}"
        IsEnabled="{Binding OpenUserSaveDirectoryEnabled}"
        ToolTip.Tip="{ext:Locale GameListContextMenuOpenUserSaveDirectoryToolTip}" />
    <MenuItem
        Command="{Binding OpenDeviceSaveDirectory}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuOpenDeviceSaveDirectory}"
        IsEnabled="{Binding OpenDeviceSaveDirectoryEnabled}"
        ToolTip.Tip="{ext:Locale GameListContextMenuOpenDeviceSaveDirectoryToolTip}" />
    <MenuItem
        Command="{Binding OpenBcatSaveDirectory}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuOpenBcatSaveDirectory}"
        IsEnabled="{Binding OpenBcatSaveDirectoryEnabled}"
        ToolTip.Tip="{ext:Locale GameListContextMenuOpenBcatSaveDirectoryToolTip}" />
    <Separator />
    <MenuItem
        Command="{Binding OpenTitleUpdateManager}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuManageTitleUpdates}"
        Icon="{ext:Icon fa-solid fa-code-compare}"
        ToolTip.Tip="{ext:Locale GameListContextMenuManageTitleUpdatesToolTip}" />
    <MenuItem
        Command="{Binding OpenDownloadableContentManager}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuManageDlc}"
        Icon="{ext:Icon fa-solid fa-download}"
        ToolTip.Tip="{ext:Locale GameListContextMenuManageDlcToolTip}" />
    <MenuItem
        Command="{Binding OpenCheatManager}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuManageCheat}"
        Icon="{ext:Icon fa-solid fa-code}"
        ToolTip.Tip="{ext:Locale GameListContextMenuManageCheatToolTip}" />
    <MenuItem
        Command="{Binding OpenModManager}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuManageMod}"
        Icon="{ext:Icon mdi-view-module}"
        ToolTip.Tip="{ext:Locale GameListContextMenuManageModToolTip}" />
    <Separator />
    <MenuItem
        Command="{Binding OpenModsDirectory}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuOpenModsDirectory}"
        Icon="{ext:Icon mdi-folder-file}"
        ToolTip.Tip="{ext:Locale GameListContextMenuOpenModsDirectoryToolTip}" />
    <MenuItem
        Command="{Binding OpenSdModsDirectory}"
        CommandParameter="{Binding}"
        Header="{ext:Locale GameListContextMenuOpenSdModsDirectory}"
        Icon="{ext:Icon mdi-folder-file}"
        ToolTip.Tip="{ext:Locale GameListContextMenuOpenSdModsDirectoryToolTip}" />
    <Separator />
	<MenuItem
        Command="{Binding TrimXci}"
        CommandParameter="{Binding}"
		Header="{ext:Locale GameListContextMenuTrimXCI}"
        IsEnabled="{Binding TrimXCIEnabled}"
		ToolTip.Tip="{ext:Locale GameListContextMenuTrimXCIToolTip}" />
    <MenuItem Header="{ext:Locale GameListContextMenuCacheManagement}" Icon="{ext:Icon mdi-cached}">
        <MenuItem
            Command="{Binding PurgePtcCache}"
            CommandParameter="{Binding}"
            Header="{ext:Locale GameListContextMenuCacheManagementPurgePptc}"
            Icon="{ext:Icon mdi-refresh}"
            ToolTip.Tip="{ext:Locale GameListContextMenuCacheManagementPurgePptcToolTip}" />
        <MenuItem
            Command="{Binding NukePtcCache}"
            CommandParameter="{Binding}"
            Header="{ext:Locale GameListContextMenuCacheManagementNukePptc}"
            Icon="{ext:Icon mdi-delete-alert}"
            ToolTip.Tip="{ext:Locale GameListContextMenuCacheManagementNukePptcToolTip}" />
        <MenuItem
            Command="{Binding PurgeShaderCache}"
            CommandParameter="{Binding}"
            Header="{ext:Locale GameListContextMenuCacheManagementPurgeShaderCache}"
            Icon="{ext:Icon mdi-delete-alert}"
            ToolTip.Tip="{ext:Locale GameListContextMenuCacheManagementPurgeShaderCacheToolTip}" />
        <MenuItem
            Command="{Binding OpenPtcDirectory}"
            CommandParameter="{Binding}"
            Header="{ext:Locale GameListContextMenuCacheManagementOpenPptcDirectory}"
            Icon="{ext:Icon mdi-folder-arrow-up-down}"
            ToolTip.Tip="{ext:Locale GameListContextMenuCacheManagementOpenPptcDirectoryToolTip}" />
        <MenuItem
            Command="{Binding OpenShaderCacheDirectory}"
            CommandParameter="{Binding}"
            Header="{ext:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectory}"
            Icon="{ext:Icon mdi-folder-arrow-up-down}"
            ToolTip.Tip="{ext:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectoryToolTip}" />
    </MenuItem>
    <MenuItem Header="{ext:Locale GameListContextMenuExtractData}">
        <MenuItem
            Command="{Binding ExtractApplicationExeFs}"
            CommandParameter="{Binding}"
            Header="{ext:Locale GameListContextMenuExtractDataExeFS}"
            ToolTip.Tip="{ext:Locale GameListContextMenuExtractDataExeFSToolTip}" />
        <MenuItem
            Command="{Binding ExtractApplicationRomFs}"
            CommandParameter="{Binding}"
            Header="{ext:Locale GameListContextMenuExtractDataRomFS}"
            ToolTip.Tip="{ext:Locale GameListContextMenuExtractDataRomFSToolTip}" />
        <MenuItem
            IsVisible="{Binding HasDlc}"
            Command="{Binding ExtractApplicationAocRomFs}"
            CommandParameter="{Binding}"
            Header="{ext:Locale GameListContextMenuExtractDataAocRomFS}"
            ToolTip.Tip="{ext:Locale GameListContextMenuExtractDataAocRomFSToolTip}" />
        <MenuItem
            Command="{Binding ExtractApplicationLogo}"
            CommandParameter="{Binding}"
            Header="{ext:Locale GameListContextMenuExtractDataLogo}"
            ToolTip.Tip="{ext:Locale GameListContextMenuExtractDataLogoToolTip}" />
    </MenuItem>
</MenuFlyout>
