Meta - Replace WPF projects with Avalonia projects

This commit is contained in:
Robert committed 2022-03-27 11:55:26 +02:00
1 parent fcf0376a9a
commit d7f3ee1190
1110 files changed
+10872 -52240

No files matched your search

+130
View File
@@ -0,0 +1,130 @@
<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:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="900"
x:Class="Artemis.UI.Screens.Home.HomeView">
<Border Classes="router-container">
<Grid RowDefinitions="200,*">
<Image Grid.Row="0"
Grid.RowSpan="2"
VerticalAlignment="Top"
Source="/Assets/Images/home-banner.png"
Height="200"
Stretch="UniformToFill" />
<!-- TODO: Replace with a shadow when available -->
<TextBlock Grid.Row="0"
TextWrapping="Wrap"
Foreground="Black"
FontSize="32"
Margin="32"
Text=" Welcome to Artemis, the unified RGB platform." />
<TextBlock Grid.Row="0"
TextWrapping="Wrap"
Foreground="White"
FontSize="32"
Margin="30"
Text=" Welcome to Artemis, the unified RGB platform." />
<Grid Grid.Row="1" MaxWidth="840" Margin="30" VerticalAlignment="Bottom" ColumnDefinitions="*,*" RowDefinitions="*,*">
<Border Classes="card" Margin="8" Grid.ColumnSpan="2" ClipToBounds="True">
<Grid VerticalAlignment="Stretch" RowDefinitions="Auto,Auto" ColumnDefinitions="150,*">
<avalonia:MaterialIcon Kind="Plug" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Classes="h3">Plugins</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top">
Artemis is built up using plugins. This means devices, brushes, effects and modules (for supporting games) can all be added via plugins.
</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top" Margin="0 15">
Under Settings > Plugins you can find your currently installed plugins, these default plugins are created by Artemis developers. We're also keeping track of a list of third-party plugins on our wiki.
</TextBlock>
</StackPanel>
<controls:HyperlinkButton Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0" NavigateUri="https://wiki.artemis-rgb.com/en/guides/user/plugins" HorizontalAlignment="Right">
<controls:HyperlinkButton.ContextMenu>
<ContextMenu>
<MenuItem Header="Test"></MenuItem>
</ContextMenu>
</controls:HyperlinkButton.ContextMenu>
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="OpenInBrowser" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Get more plugins</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
</Grid>
</Border>
<Border Classes="card" Margin="8" Grid.Row="1" Grid.Column="0" ClipToBounds="True">
<Grid VerticalAlignment="Stretch" RowDefinitions="150,95" ColumnDefinitions="150,*">
<avalonia:MaterialIcon Kind="Discord" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center" />
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Classes="h3">Have a chat</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top">
If you need help, have some feedback or have any other questions feel free to contact us through any of the following channels.
</TextBlock>
</StackPanel>
<DockPanel Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0">
<Grid Margin="8" RowDefinitions="*,*">
<controls:HyperlinkButton Grid.Row="0" NavigateUri="https://github.com/Artemis-RGB/Artemis">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Gift" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">GitHub</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<controls:HyperlinkButton Grid.Row="0" HorizontalAlignment="Right" NavigateUri="https://artemis-rgb.com">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Web" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Website</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<controls:HyperlinkButton Grid.Row="1" NavigateUri="https://discordapp.com/invite/S3MVaC9">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Discord" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Discord</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<controls:HyperlinkButton Grid.Row="1" HorizontalAlignment="Right" NavigateUri="mailto:spoinky.nl@gmail.com">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Email" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">E-mail</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
</Grid>
</DockPanel>
</Grid>
</Border>
<Border Classes="card" Margin="8" Grid.Row="1" Grid.Column="1" ClipToBounds="True">
<Grid VerticalAlignment="Stretch" RowDefinitions="150,95" ColumnDefinitions="150,*">
<avalonia:MaterialIcon Kind="Github" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center" />
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Classes="h3">Open Source</TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top">
This project is open source. If you like it and want to say thanks you could hit the GitHub Star button, I like numbers.
</TextBlock>
</StackPanel>
<controls:HyperlinkButton Grid.Row="1"
Grid.Column="0"
HorizontalAlignment="Center"
NavigateUri="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VQBAEJYUFLU4J">
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Gift" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Donate</TextBlock>
</StackPanel>
</controls:HyperlinkButton>
<TextBlock Grid.Row="1"
Grid.Column="1"
Foreground="{DynamicResource MaterialDesignBodyLight}"
TextWrapping="Wrap"
VerticalAlignment="Center">
Feel like making a donation? It would be gratefully received. Click the button to donate via PayPal.
</TextBlock>
</Grid>
</Border>
</Grid>
</Grid>
</Border>
</UserControl>
@@ -0,0 +1,18 @@
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Home
{
public class HomeView : ReactiveUserControl<HomeViewModel>
{
public HomeView()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
}
-222
View File
@@ -1,222 +0,0 @@
<UserControl x:Class="Artemis.UI.Screens.Home.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:home="clr-namespace:Artemis.UI.Screens.Home"
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
mc:Ignorable="d"
d:DesignHeight="574.026"
d:DesignWidth="1029.87"
d:DataContext="{d:DesignInstance home:HomeViewModel}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
<!-- throw in some extra colour for our floating action button -->
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignColors;component/Themes/MaterialDesignColor.Green.Named.Primary.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid Margin="0,0,0,-188">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid HorizontalAlignment="Center" VerticalAlignment="Top" Margin="16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="{svgc:SvgImage Source=/Resources/Images/Logo/bow.svg}" Height="80" Width="80" />
<TextBlock Grid.Column="1" Margin="24 0 0 0" VerticalAlignment="Center" Style="{StaticResource MaterialDesignHeadline4TextBlock}" TextWrapping="Wrap">
<Run Text="Welcome to Artemis, the unified" />
<Run Text="RGB">
<Run.Foreground>
<LinearGradientBrush EndPoint="0,0" StartPoint="1,1">
<GradientStop Color="#f19d25" />
<GradientStop Color="#f63d3d" Offset="0.2" />
<GradientStop Color="#c93cec" Offset="0.4" />
<GradientStop Color="#2667f4" Offset="0.6" />
<GradientStop Color="#1cb6e7" Offset="0.8" />
<GradientStop Color="#2df4b5" Offset="1" />
</LinearGradientBrush>
</Run.Foreground>
</Run>
<Run Text="platform." />
</TextBlock>
</Grid>
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Margin="0 0 0 32">
<StackPanel>
<materialDesign:Card Width="852" Margin="8" Height="Auto">
<Grid VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<materialDesign:PackIcon Kind="Plug" Width="140" Height="140" HorizontalAlignment="Center" VerticalAlignment="Center" />
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Style="{StaticResource MaterialDesignHeadline5TextBlock}" Margin="16 16 16 8">Plugins</TextBlock>
<TextBlock Style="{StaticResource MaterialDesignTextBlock}"
TextWrapping="Wrap" Margin="16 0 16 8"
Foreground="{DynamicResource MaterialDesignBodyLight}"
VerticalAlignment="Top">
Artemis is built up using plugins. This means devices, brushes, effects and modules (for supporting games!) can all be added via plugins. <LineBreak /> <LineBreak />
Under Settings > Plugins you can find your currently installed plugins, these default plugins are created by Artemis developers.
<LineBreak /> <LineBreak />
We're also keeping track of a list of third-party plugins on our wiki.
</TextBlock>
</StackPanel>
<Border Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0" BorderThickness="0 1 0 0" BorderBrush="{DynamicResource MaterialDesignDivider}" Padding="8">
<Button Style="{DynamicResource MaterialDesignFlatButton}"
HorizontalAlignment="Right"
Command="{s:Action OpenUrl}"
CommandParameter="https://wiki.artemis-rgb.com/en/guides/user/plugins">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="OpenInBrowser" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Get more plugins</TextBlock>
</StackPanel>
</Button>
</Border>
</Grid>
</materialDesign:Card>
<StackPanel Orientation="Horizontal">
<materialDesign:Card Width="420" Margin="8 2 4 16" Height="Auto">
<Grid VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="175" />
<RowDefinition Height="95" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<materialDesign:PackIcon Kind="Discord" Width="140" Height="140"
HorizontalAlignment="Center" VerticalAlignment="Center" />
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Style="{StaticResource MaterialDesignHeadline5TextBlock}" Margin="16 16 16 8">Have a chat</TextBlock>
<TextBlock Style="{StaticResource MaterialDesignTextBlock}"
TextWrapping="Wrap" Margin="16 0 16 8"
Foreground="{DynamicResource MaterialDesignBodyLight}"
VerticalAlignment="Top">
If you need help, have some feedback or have any other questions feel free to contact us through any of the
following channels.
</TextBlock>
</StackPanel>
<Border Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0" BorderThickness="0 1 0 0"
BorderBrush="{DynamicResource MaterialDesignDivider}" Padding="8">
<DockPanel>
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Button Style="{DynamicResource MaterialDesignFlatButton}"
HorizontalAlignment="Left"
x:Name="GitHubButton" Command="{s:Action OpenUrl}"
CommandParameter="https://github.com/Artemis-RGB/Artemis">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Github" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">GitHub</TextBlock>
</StackPanel>
</Button>
<Button Grid.Row="0" Style="{DynamicResource MaterialDesignFlatButton}"
HorizontalAlignment="Right"
x:Name="WebsiteButton" Command="{s:Action OpenUrl}"
CommandParameter="https://artemis-rgb.com">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Web" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Website</TextBlock>
</StackPanel>
</Button>
<Button Grid.Row="1" Style="{DynamicResource MaterialDesignFlatButton}"
HorizontalAlignment="Left"
x:Name="DiscordButton" Command="{s:Action OpenUrl}"
CommandParameter="https://discordapp.com/invite/S3MVaC9">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Discord" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Discord</TextBlock>
</StackPanel>
</Button>
<Button Grid.Row="1" Style="{DynamicResource MaterialDesignFlatButton}"
HorizontalAlignment="Right"
x:Name="MailButton" Command="{s:Action OpenUrl}"
CommandParameter="mailto:spoinky.nl@gmail.com">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Email" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">E-mail</TextBlock>
</StackPanel>
</Button>
</Grid>
</DockPanel>
</Border>
</Grid>
</materialDesign:Card>
<materialDesign:Card Width="420" Margin="8 2 4 16" Height="Auto">
<Grid VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="175" />
<RowDefinition Height="95" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<materialDesign:PackIcon Kind="Github" Width="160" Height="160"
HorizontalAlignment="Center" VerticalAlignment="Center" />
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Style="{StaticResource MaterialDesignHeadline5TextBlock}" Margin="16 16 16 8">Open Source</TextBlock>
<TextBlock Style="{StaticResource MaterialDesignTextBlock}"
TextWrapping="Wrap" Margin="16 0 16 8"
Foreground="{DynamicResource MaterialDesignBodyLight}"
VerticalAlignment="Top">
This project is completely open source. If you like it and want to say thanks you could hit the GitHub Star button,
I like numbers. You could even make plugins, there's a full documentation on the website
</TextBlock>
</StackPanel>
<Border Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0" BorderThickness="0 1 0 0"
BorderBrush="{DynamicResource MaterialDesignDivider}" Padding="8">
<DockPanel>
<Button Style="{DynamicResource MaterialDesignFlatButton}"
DockPanel.Dock="Right"
x:Name="DonateButton"
Command="{s:Action OpenUrl}"
CommandParameter="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=VQBAEJYUFLU4J">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Gift" />
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Donate</TextBlock>
</StackPanel>
</Button>
<TextBlock Foreground="{DynamicResource MaterialDesignBodyLight}"
TextWrapping="Wrap"
Margin="16"
VerticalAlignment="Center">
Feel like you want to make a donation? It would be gratefully received. Click the button to donate via PayPal.
</TextBlock>
</DockPanel>
</Border>
</Grid>
</materialDesign:Card>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</UserControl>
+2 -8
View File
@@ -1,18 +1,12 @@
using Artemis.UI.Ninject.Factories;
using ReactiveUI;
namespace Artemis.UI.Screens.Home
{
public class HomeViewModel : MainScreenViewModel
{
public HomeViewModel(IHeaderVmFactory headerVmFactory)
public HomeViewModel(IScreen hostScreen) : base(hostScreen, "home")
{
DisplayName = "Home";
HeaderViewModel = headerVmFactory.SimpleHeaderViewModel(DisplayName);
}
public void OpenUrl(string url)
{
Core.Utilities.OpenUrl(url);
}
}
}