mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-02-06 17:49:43 +00:00
Menu opens
This commit is contained in:
parent
1c47694f9f
commit
c547a7d4f2
3 changed files with 77 additions and 28 deletions
|
@ -46,6 +46,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public object SelectedDLCs { get; }
|
||||||
|
|
||||||
public DownloadableContentManagerViewModel(VirtualFileSystem virtualFileSystem, ulong titleId, string titleName)
|
public DownloadableContentManagerViewModel(VirtualFileSystem virtualFileSystem, ulong titleId, string titleName)
|
||||||
{
|
{
|
||||||
_virtualFileSystem = virtualFileSystem;
|
_virtualFileSystem = virtualFileSystem;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||||
xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models"
|
xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models"
|
||||||
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||||
Width="500"
|
Width="500"
|
||||||
Height="300"
|
Height="300"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
@ -18,32 +19,16 @@
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<DockPanel
|
|
||||||
Grid.Row="2"
|
|
||||||
Margin="0"
|
|
||||||
HorizontalAlignment="Left">
|
|
||||||
<Button
|
|
||||||
Name="EnableAllButton"
|
|
||||||
MinWidth="90"
|
|
||||||
Margin="5"
|
|
||||||
Command="{ReflectionBinding EnableAll}">
|
|
||||||
<TextBlock Text="{locale:Locale DlcManagerEnableAllButton}" />
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
Name="DisableAllButton"
|
|
||||||
MinWidth="90"
|
|
||||||
Margin="5"
|
|
||||||
Command="{ReflectionBinding DisableAll}">
|
|
||||||
<TextBlock Text="{locale:Locale DlcManagerDisableAllButton}" />
|
|
||||||
</Button>
|
|
||||||
</DockPanel>
|
|
||||||
<Border
|
<Border
|
||||||
Grid.Row="3"
|
Grid.Row="0"
|
||||||
Margin="5"
|
Margin="0 0 0 24"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
BorderBrush="Gray"
|
BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
|
||||||
BorderThickness="1">
|
BorderThickness="1"
|
||||||
|
CornerRadius="5"
|
||||||
|
Padding="2.5">
|
||||||
|
<!--
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
HorizontalScrollBarVisibility="Auto"
|
HorizontalScrollBarVisibility="Auto"
|
||||||
|
@ -71,7 +56,6 @@
|
||||||
<TextBlock Text="{locale:Locale DlcManagerTableHeadingEnabledLabel}" />
|
<TextBlock Text="{locale:Locale DlcManagerTableHeadingEnabledLabel}" />
|
||||||
</DataGridTemplateColumn.Header>
|
</DataGridTemplateColumn.Header>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
<!--
|
|
||||||
<DataGridTextColumn Width="140" Binding="{Binding TitleId}">
|
<DataGridTextColumn Width="140" Binding="{Binding TitleId}">
|
||||||
<DataGridTextColumn.Header>
|
<DataGridTextColumn.Header>
|
||||||
<TextBlock Text="{locale:Locale DlcManagerTableHeadingTitleIdLabel}" />
|
<TextBlock Text="{locale:Locale DlcManagerTableHeadingTitleIdLabel}" />
|
||||||
|
@ -87,10 +71,62 @@
|
||||||
<TextBlock Text="{locale:Locale DlcManagerTableHeadingContainerPathLabel}" />
|
<TextBlock Text="{locale:Locale DlcManagerTableHeadingContainerPathLabel}" />
|
||||||
</DataGridTextColumn.Header>
|
</DataGridTextColumn.Header>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
-->
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
-->
|
||||||
|
<ListBox
|
||||||
|
VirtualizationMode="None"
|
||||||
|
Background="Transparent"
|
||||||
|
SelectedItems="{Binding SelectedDLCs, Mode=TwoWay}"
|
||||||
|
Items="{Binding DownloadableContents}">
|
||||||
|
<ListBox.DataTemplates>
|
||||||
|
<DataTemplate
|
||||||
|
DataType="models:DownloadableContentModel">
|
||||||
|
<Panel Margin="10">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Text="{Binding ContainerPath}" />
|
||||||
|
<StackPanel
|
||||||
|
Spacing="10"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
HorizontalAlignment="Right">
|
||||||
|
<Button
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Padding="10"
|
||||||
|
MinWidth="0"
|
||||||
|
MinHeight="0"
|
||||||
|
Click="OpenLocation">
|
||||||
|
<ui:SymbolIcon
|
||||||
|
Symbol="OpenFolder"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Padding="10"
|
||||||
|
MinWidth="0"
|
||||||
|
MinHeight="0"
|
||||||
|
Click="RemoveDLC">
|
||||||
|
<ui:SymbolIcon
|
||||||
|
Symbol="Cancel"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</Panel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.DataTemplates>
|
||||||
|
<ListBox.Styles>
|
||||||
|
<Style Selector="ListBoxItem">
|
||||||
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
</Style>
|
||||||
|
</ListBox.Styles>
|
||||||
|
</ListBox>
|
||||||
</Border>
|
</Border>
|
||||||
<Panel
|
<Panel
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Styling;
|
using Avalonia.Styling;
|
||||||
using FluentAvalonia.UI.Controls;
|
using FluentAvalonia.UI.Controls;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
|
@ -28,7 +29,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
|
|
||||||
RemoveButton.IsEnabled = false;
|
RemoveButton.IsEnabled = false;
|
||||||
|
|
||||||
DlcDataGrid.SelectionChanged += DlcDataGrid_SelectionChanged;
|
// DlcDataGrid.SelectionChanged += DlcDataGrid_SelectionChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task Show(VirtualFileSystem virtualFileSystem, ulong titleId, string titleName)
|
public static async Task Show(VirtualFileSystem virtualFileSystem, ulong titleId, string titleName)
|
||||||
|
@ -38,7 +39,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
PrimaryButtonText = "",
|
PrimaryButtonText = "",
|
||||||
SecondaryButtonText = "",
|
SecondaryButtonText = "",
|
||||||
CloseButtonText = "",
|
CloseButtonText = "",
|
||||||
Content = new DownloadableContentManagerViewModel(virtualFileSystem, titleId, titleName),
|
Content = new DownloadableContentManagerWindow(virtualFileSystem, titleId, titleName),
|
||||||
Title = string.Format(LocaleManager.Instance[LocaleKeys.DlcWindowTitle], titleName, titleId.ToString("X16"))
|
Title = string.Format(LocaleManager.Instance[LocaleKeys.DlcWindowTitle], titleName, titleId.ToString("X16"))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,7 +53,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
|
|
||||||
private void DlcDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void DlcDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
RemoveButton.IsEnabled = (DlcDataGrid.SelectedItems.Count > 0);
|
// RemoveButton.IsEnabled = (DlcDataGrid.SelectedItems.Count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveAndClose()
|
public void SaveAndClose()
|
||||||
|
@ -60,5 +61,15 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
ViewModel.Save();
|
ViewModel.Save();
|
||||||
((ContentDialog)Parent).Hide();
|
((ContentDialog)Parent).Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RemoveDLC(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
throw new System.NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OpenLocation(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
throw new System.NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue