MainWindow.axaml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <Window xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:vm="using:VeloeMinecraftLauncher.ViewModels"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:titlebars="using:VeloeMinecraftLauncher.Views.TitleBar"
  7. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  8. Width="800" Height="450"
  9. MaxWidth="800" MaxHeight="450"
  10. x:Class="VeloeMinecraftLauncher.Views.MainWindow"
  11. Icon="/Assets/avalonia-logo.ico"
  12. Title="VeloeMinecraftLauncher"
  13. TransparencyLevelHint="AcrylicBlur"
  14. Background="Black"
  15. CanResize="False"
  16. ExtendClientAreaToDecorationsHint="True"
  17. ExtendClientAreaChromeHints="NoChrome"
  18. ExtendClientAreaTitleBarHeightHint="-1">
  19. <Window.Background>
  20. <ImageBrush
  21. Source="avares://VeloeMinecraftLauncher/Assets/background.png"
  22. Stretch="Fill"
  23. Opacity="0.9"
  24. />
  25. </Window.Background>
  26. <Design.DataContext>
  27. <vm:MainWindowViewModel/>
  28. </Design.DataContext>
  29. <Panel>
  30. <DockPanel>
  31. <titlebars:TitleBarWindow
  32. IsSeamless="False"
  33. IsIconVisible="False"
  34. IsMaximizeVisible="False"
  35. TitleText="Veloe Minecraft Launcher"
  36. DockPanel.Dock="Top"
  37. ZIndex="997">
  38. </titlebars:TitleBarWindow>
  39. <Grid DockPanel.Dock="Left">
  40. <Grid.RowDefinitions>
  41. <RowDefinition Height="0"></RowDefinition>
  42. <RowDefinition Height="*"></RowDefinition>
  43. <RowDefinition Height="40" ></RowDefinition>
  44. <RowDefinition Height="0"></RowDefinition>
  45. </Grid.RowDefinitions>
  46. <Grid.ColumnDefinitions>
  47. <ColumnDefinition Width="*"></ColumnDefinition>
  48. </Grid.ColumnDefinitions>
  49. <Button
  50. ZIndex="999"
  51. Grid.Row="1"
  52. HorizontalAlignment="Right"
  53. VerticalAlignment="Top"
  54. Command="{Binding DownloadUpdate}"
  55. IsVisible="{Binding IsUpdateAvailable}">
  56. Update Available
  57. </Button>
  58. <TextBlock
  59. ZIndex="998"
  60. Grid.Row="1"
  61. HorizontalAlignment="Right"
  62. VerticalAlignment="Bottom"
  63. Text="{Binding StartButtonOutput}"
  64. Margin="5">
  65. </TextBlock>
  66. <TabControl
  67. Grid.Row="1"
  68. HorizontalAlignment="Stretch">
  69. <TabItem
  70. Header="Servers"
  71. VerticalContentAlignment="Center">
  72. <StackPanel
  73. Name = "ServersStackPanel"
  74. Orientation="Horizontal"
  75. HorizontalAlignment="Stretch">
  76. </StackPanel>
  77. </TabItem>
  78. <TabItem>
  79. <TabItem.Header>
  80. <TextBlock VerticalAlignment="Center">Console</TextBlock>
  81. </TabItem.Header>
  82. <Panel
  83. VerticalAlignment="Stretch"
  84. HorizontalAlignment="Stretch"
  85. Margin="0 0 0 5">
  86. <Border Background="Black" Opacity="0.2" CornerRadius="5" />
  87. <ScrollViewer
  88. Name="ConsoleScroll"
  89. HorizontalScrollBarVisibility="Auto"
  90. VerticalAlignment="Stretch"
  91. HorizontalAlignment="Stretch">
  92. <TextBlock
  93. Text="{Binding ConsoleText}"
  94. VerticalAlignment="Stretch"
  95. Width="760"
  96. Margin="5,5,5,5"
  97. TextWrapping="Wrap"
  98. ScrollViewer.VerticalScrollBarVisibility="Visible"
  99. MaxLines="99999">
  100. </TextBlock>
  101. </ScrollViewer>
  102. </Panel>
  103. </TabItem>
  104. <TabItem>
  105. <TabItem.Header>
  106. <TextBlock VerticalAlignment="Center">Changelog</TextBlock>
  107. </TabItem.Header>
  108. <Panel
  109. VerticalAlignment="Stretch"
  110. HorizontalAlignment="Stretch"
  111. Margin="0 0 0 5">
  112. <Border Background="Black" Opacity="0.2" CornerRadius="5" />
  113. <ScrollViewer
  114. HorizontalScrollBarVisibility="Auto"
  115. VerticalAlignment="Stretch"
  116. HorizontalAlignment="Stretch">
  117. <StackPanel
  118. Name="ChangeLogStackPanel"
  119. Width="760"
  120. Margin="5,5,5,5">
  121. </StackPanel>
  122. </ScrollViewer>
  123. </Panel>
  124. </TabItem>
  125. </TabControl>
  126. <StackPanel
  127. Grid.Row="2"
  128. Orientation="Horizontal"
  129. HorizontalAlignment="Center">
  130. <Button
  131. Content="{Binding DownloadButton}"
  132. Command="{Binding OnClickCommand}">
  133. </Button>
  134. <Button
  135. Content="{Binding SettingsButton}"
  136. Command="{Binding OpenSettings}">
  137. </Button>
  138. <TextBlock
  139. Margin="3">
  140. </TextBlock>
  141. <ComboBox
  142. Items="{Binding DownloadedVersions}"
  143. PlaceholderText="Select version"
  144. SelectedItem="Binding DownloadedVersion"
  145. SelectedIndex="{Binding DownloadedIndex}"
  146. Width="220"
  147. VerticalAlignment="Center"
  148. HorizontalAlignment="Center">
  149. </ComboBox>
  150. <TextBlock
  151. Margin="3">
  152. </TextBlock>
  153. <TextBox
  154. Text="{Binding Username}"
  155. Watermark="Username"
  156. MinWidth="190"
  157. MaxWidth="220"
  158. VerticalAlignment="Center"
  159. HorizontalAlignment="Center">
  160. <TextBox.Styles>
  161. <Style Selector="DataValidationErrors">
  162. <Setter Property="Template" Value="{DynamicResource TooltipDataValidationContentTemplate}" />
  163. <Setter Property="ErrorTemplate" Value="{DynamicResource TooltipDataValidationErrorTemplate}" />
  164. </Style>
  165. </TextBox.Styles>
  166. </TextBox>
  167. <TextBlock
  168. Margin="3">
  169. </TextBlock>
  170. <Button
  171. Content="{Binding StartButton}"
  172. Command="{Binding StartMinecraft}"
  173. IsEnabled="{Binding IsStartButtonEnabled}">
  174. </Button>
  175. </StackPanel>
  176. <StackPanel Orientation="Horizontal" Grid.Row="2">
  177. <TextBox Text="{Binding ArgumentsBox}" TextWrapping="Wrap" Width="680" Height="200" IsVisible="false"></TextBox>
  178. <Button Content="{Binding StartButton}" Command="{Binding StartMinecraftCustom}" IsVisible="false"></Button>
  179. </StackPanel>
  180. </Grid>
  181. </DockPanel>
  182. </Panel>
  183. </Window>