Skip to content

Instantly share code, notes, and snippets.

@DooblyNoobly
Created November 18, 2019 03:07
Show Gist options
  • Select an option

  • Save DooblyNoobly/a9c309237de54dea7d0357e803ac0797 to your computer and use it in GitHub Desktop.

Select an option

Save DooblyNoobly/a9c309237de54dea7d0357e803ac0797 to your computer and use it in GitHub Desktop.
Current Launcher view
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:avc="clr-namespace:Avalonia.Data.Converters;assembly=Avalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
TextBlock.FontSize="18"
Background="#19212c"
x:Class="UnitystationLauncher.Views.LauncherView">
<DockPanel>
<Border DockPanel.Dock="Top" BorderThickness="0 0 0 1" BorderBrush="gray">
<DockPanel LastChildFill="False" Background="#2c3d50" Height="40">
<Image Source="/Assets/userico.jpg" DockPanel.Dock="Left" HorizontalAlignment="Left" Margin="5 3 0 3" MaxWidth="40"/>
<Viewbox MaxWidth="130" MaxHeight="22" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border Margin="4 0 0 0" BorderThickness="0 0 1 0" VerticalAlignment="Center" MinWidth="60" >
<TextBlock Text="{Binding Username}" VerticalAlignment="Center" Margin="4 1 6 1" HorizontalAlignment="Center" TextAlignment="Center" FontSize="10" TextWrapping="Wrap" MaxWidth="130" MaxHeight="20"/>
</Border>
</Viewbox>
<Button Command="{Binding Logout}" Margin="0 5 7 5" FontSize="14" BorderThickness="1" BorderBrush="Gray" DockPanel.Dock="Right" MinWidth="65" Background="#45458BD1">Logout</Button>
</DockPanel>
</Border>
<DockPanel Name="Columns">
<Border DockPanel.Dock="Left" BorderThickness="0 0 2 0" BorderBrush="gray" HorizontalAlignment="Left" Width="200">
<StackPanel>
<ListBox Items="{Binding Panels}" SelectedItem="{Binding SelectedPanel}" BorderThickness="0">
<ListBox.Styles>
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="#4f769d" />
</Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="#295077" />
</Style>
</ListBox.Styles>
<ListBox.DataTemplates>
<DataTemplate>
<DockPanel Height="50" Width="180">
<!--<Viewbox Width="48" Height="48" Margin="10 0">
<Canvas Width="24" Height="24">
<Path Data="M4,1H20A1,1 0 0,1 21,2V6A1,1 0 0,1 20,7H4A1,1 0 0,1 3,6V2A1,1 0 0,1 4,1M4,9H20A1,1 0 0,1 21,10V14A1,1 0 0,1 20,15H4A1,1 0 0,1 3,14V10A1,1 0 0,1 4,9M4,17H20A1,1 0 0,1 21,18V22A1,1 0 0,1 20,23H4A1,1 0 0,1 3,22V18A1,1 0 0,1 4,17M9,5H10V3H9V5M9,13H10V11H9V13M9,21H10V19H9V21M5,3V5H7V3H5M5,11V13H7V11H5M5,19V21H7V19H5Z" Fill="LightBlue" />
</Canvas>
</Viewbox>-->
<Image DockPanel.Dock="Left" Margin="10" Width="20" Height="20" Source="{Binding Icon}" HorizontalAlignment="Left"/>
<TextBlock Grid.Column="1" Margin="0 0 0 3" Text="{Binding Name}" FontSize="20" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Left" MaxWidth="150"/>
</DockPanel>
</DataTemplate>
</ListBox.DataTemplates>
</ListBox>
<Rectangle Height="1" Stretch="Uniform" Fill="gray"/>
<TextBlock Margin="5" FontSize="14" HorizontalAlignment="Center">Latest Merged PRs</TextBlock>
<ScrollViewer VerticalScrollBarVisibility="Visible" Height="363">
<ContentControl Content="{Binding News}" HorizontalAlignment="Center" Width="{Binding ElementName=Columns, Path=ColumnDefinitions[0].ViewPortWidth}"/>
</ScrollViewer>
</StackPanel>
</Border>
<StackPanel Grid.Column="1">
<StackPanel.Background>
<ImageBrush Source="/Assets/bg.jpg" />
</StackPanel.Background>
</StackPanel>
<Border>
<Border.Background>
<ImageBrush Source="avares://UnitystationLauncher/Assets/bg.jpg" Stretch="UniformToFill"/>
</Border.Background>
<UserControl Grid.Column="1" Content="{Binding SelectedPanel}"/>
</Border>
</DockPanel>
</DockPanel>
</UserControl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment