MainView.axaml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:vm="using:PCL.Communist.ViewModels"
  4. xmlns:core="using:PCL.Communist.Core"
  5. x:Class="PCL.Communist.Views.MainView"
  6. x:DataType="vm:MainViewModel" Background="#120F13">
  7. <UserControl.Styles>
  8. <Style Selector="TextBlock"><Setter Property="Foreground" Value="#F5F0F2" /></Style>
  9. <Style Selector="TextBlock.muted"><Setter Property="Foreground" Value="#B6A9B1" /><Setter Property="FontSize" Value="12" /></Style>
  10. <Style Selector="TextBlock.label"><Setter Property="FontWeight" Value="SemiBold" /><Setter Property="Margin" Value="0,0,0,8" /></Style>
  11. <Style Selector="Border.card"><Setter Property="Background" Value="#211A21" /><Setter Property="BorderBrush" Value="#3B2B35" /><Setter Property="BorderThickness" Value="1" /><Setter Property="CornerRadius" Value="16" /><Setter Property="Padding" Value="22" /></Style>
  12. <Style Selector="Button"><Setter Property="MinHeight" Value="44" /><Setter Property="CornerRadius" Value="8" /></Style>
  13. <Style Selector="TextBox"><Setter Property="MinHeight" Value="44" /><Setter Property="CornerRadius" Value="8" /></Style>
  14. <Style Selector="ComboBox"><Setter Property="MinHeight" Value="44" /><Setter Property="CornerRadius" Value="8" /></Style>
  15. </UserControl.Styles>
  16. <Grid RowDefinitions="Auto,*">
  17. <Border Padding="22,16" Background="#1B141B" BorderBrush="#382630" BorderThickness="0,0,0,1">
  18. <Grid ColumnDefinitions="Auto,*">
  19. <Image Source="/Assets/Icon.png" Width="42" Height="42" Margin="0,0,12,0" />
  20. <StackPanel Grid.Column="1" VerticalAlignment="Center" Spacing="3">
  21. <TextBlock Text="PCL Communist" FontWeight="Bold" FontSize="20" />
  22. <TextBlock Text="让所有颜色属于所有人。" Classes="muted" />
  23. </StackPanel>
  24. </Grid>
  25. </Border>
  26. <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Disabled">
  27. <StackPanel Margin="20,24" Spacing="18" MaxWidth="920" HorizontalAlignment="Stretch">
  28. <Border Background="{Binding AccentBrush}" CornerRadius="18" Padding="24,26">
  29. <StackPanel Spacing="12">
  30. <TextBlock Text="每个世界,都属于你。" FontSize="27" FontWeight="Bold" TextWrapping="Wrap" />
  31. <TextBlock Text="自由选择颜色,下载游戏,开始探索。" TextWrapping="Wrap" Foreground="#FFF2E7" />
  32. <TextBlock Text="{Binding PlatformName}" FontSize="12" FontWeight="SemiBold" />
  33. </StackPanel>
  34. </Border>
  35. <Border Classes="card" IsVisible="{Binding IsMobile}" BorderBrush="#846138">
  36. <StackPanel Spacing="8">
  37. <TextBlock Text="移动端预览" Foreground="#E7BE77" FontWeight="Bold" />
  38. <TextBlock Text="{Binding MobileNotice}" TextWrapping="Wrap" FontSize="13" />
  39. </StackPanel>
  40. </Border>
  41. <Border Classes="card">
  42. <StackPanel Spacing="14">
  43. <TextBlock Text="准备出发" FontSize="20" FontWeight="SemiBold" />
  44. <TextBlock Text="游戏版本" Classes="label" />
  45. <Grid ColumnDefinitions="*,Auto" ColumnSpacing="10">
  46. <ComboBox ItemsSource="{Binding Versions}" SelectedItem="{Binding SelectedVersion}" HorizontalAlignment="Stretch" IsEnabled="{Binding !IsBusy}" PlaceholderText="刷新列表以选择版本">
  47. <ComboBox.ItemTemplate><DataTemplate x:DataType="core:MinecraftVersion"><TextBlock Text="{Binding Id}" /></DataTemplate></ComboBox.ItemTemplate>
  48. </ComboBox>
  49. <Button Grid.Column="1" Content="刷新" Command="{Binding RefreshCommand}" />
  50. </Grid>
  51. <TextBlock Text="玩家名称" Classes="label" />
  52. <TextBox Text="{Binding PlayerName}" PlaceholderText="Player" IsEnabled="{Binding !IsBusy}" MaxLength="16" />
  53. <TextBlock Text="{Binding AccountStatus}" Classes="muted" TextWrapping="Wrap" />
  54. <WrapPanel Orientation="Horizontal">
  55. <Button Content="微软账号登录" Command="{Binding LoginCommand}" Margin="0,0,10,8" />
  56. <Button Content="退出账号" Command="{Binding LogoutCommand}" Margin="0,0,0,8" />
  57. </WrapPanel>
  58. <Border Background="#30212A" Padding="16" CornerRadius="10" IsVisible="{Binding ShowLoginCode}">
  59. <StackPanel Spacing="10">
  60. <TextBlock Text="在登录网页输入此代码" />
  61. <SelectableTextBlock Text="{Binding LoginCode}" FontSize="28" FontWeight="Bold" Foreground="#F2D29B" />
  62. <Button Content="打开微软登录网页" Click="OpenLoginSite" />
  63. <SelectableTextBlock Text="{Binding LoginAddress}" TextWrapping="Wrap" FontSize="12" />
  64. </StackPanel>
  65. </Border>
  66. <Grid ColumnDefinitions="*,*" ColumnSpacing="10">
  67. <Button Content="下载 / 校验" Command="{Binding InstallCommand}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" />
  68. <Button Grid.Column="1" Content="{Binding LaunchLabel}" Command="{Binding LaunchCommand}" Background="{Binding AccentBrush}" Foreground="White" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" FontWeight="Bold" />
  69. </Grid>
  70. <TextBlock Text="{Binding RuntimeDescription}" Classes="muted" TextWrapping="Wrap" />
  71. </StackPanel>
  72. </Border>
  73. <Border Classes="card">
  74. <StackPanel Spacing="12">
  75. <Grid ColumnDefinitions="*,Auto" ColumnSpacing="12">
  76. <TextBlock Text="{Binding Status}" TextWrapping="Wrap" VerticalAlignment="Center" FontSize="13" />
  77. <Button Grid.Column="1" Content="取消" Command="{Binding CancelCommand}" IsVisible="{Binding IsBusy}" />
  78. </Grid>
  79. <ProgressBar Value="{Binding Progress}" Minimum="0" Maximum="100" Height="5" Foreground="{Binding AccentBrush}" />
  80. </StackPanel>
  81. </Border>
  82. <Border Classes="card">
  83. <StackPanel Spacing="14">
  84. <TextBlock Text="你的启动器,你做主" FontSize="18" FontWeight="SemiBold" />
  85. <TextBlock Text="主题颜色 · 全部开放" Classes="label" />
  86. <ComboBox ItemsSource="{Binding Themes}" SelectedItem="{Binding SelectedTheme}" HorizontalAlignment="Stretch" IsEnabled="{Binding !IsBusy}">
  87. <ComboBox.ItemTemplate><DataTemplate x:DataType="vm:LauncherTheme"><TextBlock Text="{Binding Name}" /></DataTemplate></ComboBox.ItemTemplate>
  88. </ComboBox>
  89. <Expander Header="运行设置" HorizontalAlignment="Stretch">
  90. <StackPanel Spacing="10">
  91. <TextBlock Text="内存(MB)" Classes="label" />
  92. <NumericUpDown Value="{Binding MemoryMb}" Minimum="512" Maximum="32768" Increment="512" FormatString="0" IsEnabled="{Binding !IsBusy}" />
  93. <StackPanel IsVisible="{Binding IsDesktop}" Spacing="10">
  94. <TextBlock Text="Java 可执行文件(留空自动安装)" TextWrapping="Wrap" />
  95. <TextBox Text="{Binding JavaPath}" PlaceholderText="自动选择对应版本和架构" IsEnabled="{Binding !IsBusy}" />
  96. <TextBlock Text="游戏目录" />
  97. <TextBox Text="{Binding GameRoot}" IsEnabled="{Binding !IsBusy}" />
  98. </StackPanel>
  99. </StackPanel>
  100. </Expander>
  101. <Button Content="保存设置" Command="{Binding SaveSettingsCommand}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" />
  102. </StackPanel>
  103. </Border>
  104. <TextBlock Text="共产共享 · 免费使用 · 源码开放" HorizontalAlignment="Center" Classes="muted" Margin="0,4,0,12" />
  105. </StackPanel>
  106. </ScrollViewer>
  107. </Grid>
  108. </UserControl>