me-web? skeleton: Avalonia 12 app, server, packaging and CI
Build / Desktop, server and tools (push) Successful in 1m7s

The first screen (online or not, a Check button, every language with a
draft notice), the desktop and Android heads, the server's /api/info and
/api/ip, a release tool that builds deb, rpm, a Windows exe, macOS zips,
a signed APK and the server, and the Gitea workflows that run it. Rules
adapted from passolo; AGPL-3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-15 01:14:44 +02:00
commit 7589121846
76 files changed
+3082

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="MeWeb.App.App"
Name="me-web?"
RequestedThemeVariant="Dark">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://MeWeb.App/Resources/Colors.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
<Application.Styles>
<FluentTheme>
<FluentTheme.Palettes>
<ColorPaletteResources x:Key="Dark"
Accent="#E04A55"
RegionColor="#1B141C"
AltHigh="#1B141C"
BaseHigh="#F0EAEF"
ChromeMediumLow="#2C222D"
ChromeMedium="#352A36"
ChromeLow="#231B24" />
</FluentTheme.Palettes>
</FluentTheme>
<StyleInclude Source="avares://MeWeb.App/Resources/Styles.axaml" />
</Application.Styles>
</Application>
+43
View File
@@ -0,0 +1,43 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using MeWeb.App.Services;
using MeWeb.App.ViewModels;
using MeWeb.App.Views;
using Microsoft.Extensions.DependencyInjection;
namespace MeWeb.App;
public partial class App : Application
{
public static IServiceProvider Services { get; private set; }
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
#if DEBUG
this.AttachDeveloperTools();
#endif
}
public override void OnFrameworkInitializationCompleted()
{
Services = new ServiceCollection().AddMeWebApp().BuildServiceProvider();
var stored = AppSettings.Read();
Localizer.Instance.SetLanguage(Languages.Find(stored.Language) ?? Languages.ForCulture(System.Globalization.CultureInfo.CurrentUICulture));
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
desktop.MainWindow = new MainWindow { Content = CreateMainView() };
else if (ApplicationLifetime is IActivityApplicationLifetime activity)
activity.MainViewFactory = CreateMainView;
else if (ApplicationLifetime is ISingleViewApplicationLifetime single)
single.MainView = CreateMainView();
base.OnFrameworkInitializationCompleted();
}
static Control CreateMainView() => new MainView { DataContext = Services.GetRequiredService<MainViewModel>() };
}
+22
View File
@@ -0,0 +1,22 @@
using MeWeb.App.Services;
using MeWeb.App.ViewModels;
using MeWeb.Shared;
using Microsoft.Extensions.DependencyInjection;
namespace MeWeb.App;
public static class AppServices
{
public static IServiceCollection AddMeWebApp(this IServiceCollection services)
{
services.AddHttpClient(ServerClient.Name, http =>
{
http.BaseAddress = new Uri(Endpoints.Base);
http.DefaultRequestHeaders.UserAgent.ParseAdd($"me-web/{BuildInfo.Version}");
});
services.AddSingleton<ServerClient>();
services.AddTransient<MainViewModel>();
return services;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

+30
View File
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>MeWeb.App</RootNamespace>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
<EmbeddedResource Include="..\..\data\languages.json" LogicalName="languages.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" />
<PackageReference Include="Avalonia.Themes.Fluent" />
<PackageReference Include="Avalonia.Fonts.Inter" />
<PackageReference Include="AvaloniaUI.DiagnosticsSupport">
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference>
<PackageReference Include="CommunityToolkit.Mvvm" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.Http" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MeWeb.Shared\MeWeb.Shared.csproj" />
</ItemGroup>
</Project>
+26
View File
@@ -0,0 +1,26 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Color x:Key="BrandRed">#E04A55</Color>
<Color x:Key="BrandRedDark">#B23640</Color>
<Color x:Key="BrandRedLight">#EC7A82</Color>
<Color x:Key="Ground">#1B141C</Color>
<Color x:Key="Surface">#2C222D</Color>
<Color x:Key="SurfaceRaised">#352A36</Color>
<Color x:Key="Line">#3A2E3B</Color>
<Color x:Key="TextStrong">#F0EAEF</Color>
<Color x:Key="TextSoft">#A79AA6</Color>
<Color x:Key="Good">#6FCF97</Color>
<Color x:Key="Caution">#F2C14E</Color>
<Color x:Key="Bad">#E85D6C</Color>
<SolidColorBrush x:Key="BrandRedBrush" Color="{StaticResource BrandRed}" />
<SolidColorBrush x:Key="GroundBrush" Color="{StaticResource Ground}" />
<SolidColorBrush x:Key="SurfaceBrush" Color="{StaticResource Surface}" />
<SolidColorBrush x:Key="SurfaceRaisedBrush" Color="{StaticResource SurfaceRaised}" />
<SolidColorBrush x:Key="LineBrush" Color="{StaticResource Line}" />
<SolidColorBrush x:Key="TextStrongBrush" Color="{StaticResource TextStrong}" />
<SolidColorBrush x:Key="TextSoftBrush" Color="{StaticResource TextSoft}" />
<SolidColorBrush x:Key="GoodBrush" Color="{StaticResource Good}" />
<SolidColorBrush x:Key="CautionBrush" Color="{StaticResource Caution}" />
<SolidColorBrush x:Key="BadBrush" Color="{StaticResource Bad}" />
</ResourceDictionary>
+56
View File
@@ -0,0 +1,56 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style Selector="TextBlock.title">
<Setter Property="FontSize" Value="34" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="{StaticResource TextStrongBrush}" />
</Style>
<Style Selector="TextBlock.lead">
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="{StaticResource TextSoftBrush}" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="TextAlignment" Value="Center" />
</Style>
<Style Selector="TextBlock.status">
<Setter Property="FontSize" Value="22" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Foreground" Value="{StaticResource TextStrongBrush}" />
<Setter Property="TextAlignment" Value="Center" />
</Style>
<Style Selector="TextBlock.small">
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="{StaticResource TextSoftBrush}" />
</Style>
<Style Selector="Button.primary">
<Setter Property="Background" Value="{StaticResource BrandRedBrush}" />
<Setter Property="Foreground" Value="{StaticResource TextStrongBrush}" />
<Setter Property="FontSize" Value="20" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Padding" Value="40,14" />
<Setter Property="CornerRadius" Value="28" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style Selector="Button.link">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{StaticResource BrandRedBrush}" />
<Setter Property="Padding" Value="4,2" />
<Setter Property="FontSize" Value="13" />
<Setter Property="Cursor" Value="Hand" />
</Style>
<Style Selector="Ellipse.pulse">
<Style.Animations>
<Animation Duration="0:0:1.6" IterationCount="Infinite">
<KeyFrame Cue="0%">
<Setter Property="Opacity" Value="0.85" />
<Setter Property="ScaleTransform.ScaleX" Value="0.8" />
<Setter Property="ScaleTransform.ScaleY" Value="0.8" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="0" />
<Setter Property="ScaleTransform.ScaleX" Value="1.5" />
<Setter Property="ScaleTransform.ScaleY" Value="1.5" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
</Styles>
+11
View File
@@ -0,0 +1,11 @@
using System.Text.Json;
using System.Text.Json.Serialization;
namespace MeWeb.App.Services;
[JsonSourceGenerationOptions(JsonSerializerDefaults.Web, WriteIndented = true)]
[JsonSerializable(typeof(List<Language>))]
[JsonSerializable(typeof(StoredSettings))]
public partial class AppJsonContext : JsonSerializerContext
{
}
+43
View File
@@ -0,0 +1,43 @@
using System.Text.Json;
namespace MeWeb.App.Services;
public class StoredSettings
{
public string Language { get; set; }
}
public static class AppSettings
{
static readonly string Folder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "MeWeb");
static readonly string FilePath = Path.Combine(Folder, "settings.json");
public static StoredSettings Read()
{
try
{
if (!File.Exists(FilePath)) return new StoredSettings();
using var stream = File.OpenRead(FilePath);
return JsonSerializer.Deserialize(stream, AppJsonContext.Default.StoredSettings) ?? new StoredSettings();
}
catch (Exception ex) when (ex is IOException or JsonException or UnauthorizedAccessException)
{
return new StoredSettings();
}
}
public static void Write(StoredSettings settings)
{
try
{
Directory.CreateDirectory(Folder);
var temporary = FilePath + ".tmp";
using (var stream = File.Create(temporary))
JsonSerializer.Serialize(stream, settings, AppJsonContext.Default.StoredSettings);
File.Move(temporary, FilePath, overwrite: true);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
}
}
}
+41
View File
@@ -0,0 +1,41 @@
using System.Globalization;
using System.Text.Json;
namespace MeWeb.App.Services;
public class Language
{
public string Code { get; set; }
public string Name { get; set; }
public string Status { get; set; }
public bool IsDraft => Status == "draft";
}
public static class Languages
{
public static Language Fallback { get; } = new() { Code = "en", Name = "English", Status = "reviewed" };
public static IReadOnlyList<Language> All { get; } = Load();
public static Language Find(string code) =>
string.IsNullOrEmpty(code) ? null : All.FirstOrDefault(l => string.Equals(l.Code, code, StringComparison.OrdinalIgnoreCase));
public static Language ForCulture(CultureInfo culture)
{
for (var current = culture; current is not null && !string.IsNullOrEmpty(current.Name); current = current.Parent)
{
var found = Find(current.Name);
if (found is not null) return found;
}
return Fallback;
}
static List<Language> Load()
{
using var stream = typeof(Languages).Assembly.GetManifestResourceStream("languages.json");
if (stream is null) return [Fallback];
var list = JsonSerializer.Deserialize(stream, AppJsonContext.Default.ListLanguage) ?? [];
return list.Count == 0 ? [Fallback] : list.OrderBy(l => l.Name, StringComparer.Create(CultureInfo.InvariantCulture, CompareOptions.IgnoreCase)).ToList();
}
}
+52
View File
@@ -0,0 +1,52 @@
using System.ComponentModel;
using System.Globalization;
using System.Resources;
using Avalonia.Data;
using Avalonia.Markup.Xaml;
using Avalonia.Markup.Xaml.MarkupExtensions;
namespace MeWeb.App.Services;
public sealed class Localizer : INotifyPropertyChanged
{
readonly ResourceManager resources = new("MeWeb.App.Strings.Strings", typeof(Localizer).Assembly);
public static Localizer Instance { get; } = new();
public event PropertyChangedEventHandler PropertyChanged;
public Language Language { get; private set; } = Languages.Fallback;
public CultureInfo Culture { get; private set; } = CultureInfo.GetCultureInfo(Languages.Fallback.Code);
public bool IsRightToLeft => Culture.TextInfo.IsRightToLeft;
public string this[string key] => resources.GetString(key, Culture) ?? key;
public string Format(string key, params object[] args) => string.Format(Culture, this[key], args);
public void SetLanguage(Language language)
{
Language = language ?? Languages.Fallback;
Culture = CultureInfo.GetCultureInfo(Language.Code);
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.DefaultThreadCurrentUICulture = Culture;
CultureInfo.CurrentCulture = CultureInfo.CurrentUICulture = Culture;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Item[]"));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(string.Empty));
}
}
public sealed class TrExtension : MarkupExtension
{
public TrExtension()
{
}
public TrExtension(string key) => Key = key;
public string Key { get; set; }
public override object ProvideValue(IServiceProvider serviceProvider) =>
new ReflectionBindingExtension($"[{Key}]") { Mode = BindingMode.OneWay, Source = Localizer.Instance }.ProvideValue(serviceProvider);
}
+33
View File
@@ -0,0 +1,33 @@
using System.Net.Http.Json;
using MeWeb.Shared;
namespace MeWeb.App.Services;
public enum Reachability
{
Unknown,
Online,
Offline,
}
public class ServerClient(IHttpClientFactory factory)
{
public const string Name = "server";
public async Task<(Reachability State, ViewInfo Info)> Probe(CancellationToken ct)
{
try
{
var http = factory.CreateClient(Name);
using var timeout = CancellationTokenSource.CreateLinkedTokenSource(ct);
timeout.CancelAfter(TimeSpan.FromSeconds(6));
var info = await http.GetFromJsonAsync(Endpoints.Server.GET_Info, MeWebJsonContext.Default.ViewInfo, timeout.Token);
return (Reachability.Online, info);
}
catch (Exception ex) when (ex is HttpRequestException or TaskCanceledException && !ct.IsCancellationRequested)
{
return (Reachability.Offline, null);
}
}
}
+42
View File
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AppTagline" xml:space="preserve">
<value>Scopra se da questa connessione può ospitare un server suo, e che cosa lo impedisce.</value>
</data>
<data name="Check" xml:space="preserve">
<value>Verifica</value>
</data>
<data name="DraftNotice" xml:space="preserve">
<value>Questa traduzione è una bozza automatica.</value>
</data>
<data name="Language" xml:space="preserve">
<value>Lingua</value>
</data>
<data name="StatusChecking" xml:space="preserve">
<value>Verifico la connessione…</value>
</data>
<data name="StatusOffline" xml:space="preserve">
<value>Non connesso a internet</value>
</data>
<data name="StatusOnline" xml:space="preserve">
<value>Connesso a internet</value>
</data>
<data name="SuggestCorrection" xml:space="preserve">
<value>Proponi una correzione</value>
</data>
<data name="VersionLine" xml:space="preserve">
<value>me-web? {0} · software libero (AGPL-3.0)</value>
</data>
</root>
+42
View File
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AppTagline" xml:space="preserve">
<value>Find out whether you can run your own server from this connection, and what stands in the way.</value>
</data>
<data name="Check" xml:space="preserve">
<value>Check</value>
</data>
<data name="DraftNotice" xml:space="preserve">
<value>This translation is a machine draft.</value>
</data>
<data name="Language" xml:space="preserve">
<value>Language</value>
</data>
<data name="StatusChecking" xml:space="preserve">
<value>Checking the connection…</value>
</data>
<data name="StatusOffline" xml:space="preserve">
<value>Not connected to the internet</value>
</data>
<data name="StatusOnline" xml:space="preserve">
<value>Connected to the internet</value>
</data>
<data name="SuggestCorrection" xml:space="preserve">
<value>Suggest a correction</value>
</data>
<data name="VersionLine" xml:space="preserve">
<value>me-web? {0} · free software (AGPL-3.0)</value>
</data>
</root>
+70
View File
@@ -0,0 +1,70 @@
using Avalonia.Media;
using Avalonia.Platform.Storage;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using MeWeb.App.Services;
using MeWeb.Shared;
namespace MeWeb.App.ViewModels;
public partial class MainViewModel(ServerClient server) : ObservableObject
{
public const string CorrectionsUrl = "https://git.thepra.dev/Arasaka/MeWeb/issues";
public IReadOnlyList<Language> Languages { get; } = Services.Languages.All;
public ILauncher Launcher { get; set; }
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(StatusFormatted), nameof(ShowOnline), nameof(ShowOffline), nameof(ShowChecking))]
public partial Reachability Status { get; set; } = Reachability.Unknown;
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(ShowDraftNotice), nameof(Flow))]
public partial Language SelectedLanguage { get; set; } = Localizer.Instance.Language;
public bool ShowChecking => Status == Reachability.Unknown;
public bool ShowOnline => Status == Reachability.Online;
public bool ShowOffline => Status == Reachability.Offline;
public bool ShowDraftNotice => SelectedLanguage?.IsDraft == true;
public FlowDirection Flow => Localizer.Instance.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
public string StatusFormatted => Status switch
{
Reachability.Online => Localizer.Instance["StatusOnline"],
Reachability.Offline => Localizer.Instance["StatusOffline"],
_ => Localizer.Instance["StatusChecking"],
};
public string VersionFormatted => Localizer.Instance.Format("VersionLine", BuildInfo.Version);
[RelayCommand]
async Task Refresh(CancellationToken ct)
{
Status = Reachability.Unknown;
var (state, _) = await server.Probe(ct);
Status = state;
}
[RelayCommand]
async Task OpenCorrections()
{
if (Launcher is null) return;
await Launcher.LaunchUriAsync(new Uri(CorrectionsUrl));
}
partial void OnSelectedLanguageChanged(Language value)
{
if (value is null || value.Code == Localizer.Instance.Language.Code) return;
Localizer.Instance.SetLanguage(value);
var settings = AppSettings.Read();
settings.Language = value.Code;
AppSettings.Write(settings);
OnPropertyChanged(nameof(StatusFormatted));
OnPropertyChanged(nameof(VersionFormatted));
OnPropertyChanged(nameof(Flow));
}
}
+50
View File
@@ -0,0 +1,50 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:MeWeb.App.ViewModels"
xmlns:s="using:MeWeb.App.Services"
x:Class="MeWeb.App.Views.MainView"
x:DataType="vm:MainViewModel"
FlowDirection="{Binding Flow}"
Background="{StaticResource GroundBrush}">
<DockPanel Margin="24,18">
<Grid DockPanel.Dock="Top" ColumnDefinitions="*,Auto">
<TextBlock Grid.Column="0" Classes="title" Text="me-web?" VerticalAlignment="Center" />
<ComboBox Grid.Column="1" MinWidth="180" VerticalAlignment="Center"
AutomationProperties.AutomationId="main-language"
AutomationProperties.Name="{s:Tr Language}"
ItemsSource="{Binding Languages}"
SelectedItem="{Binding SelectedLanguage}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="s:Language">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
<StackPanel DockPanel.Dock="Bottom" Spacing="6" HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal" Spacing="8" HorizontalAlignment="Center" IsVisible="{Binding ShowDraftNotice}">
<TextBlock Classes="small" Text="{s:Tr DraftNotice}" VerticalAlignment="Center" />
<Button Classes="link" Content="{s:Tr SuggestCorrection}"
AutomationProperties.AutomationId="main-suggest-correction"
Command="{Binding OpenCorrectionsCommand}" />
</StackPanel>
<TextBlock Classes="small" Text="{Binding VersionFormatted}" HorizontalAlignment="Center" />
</StackPanel>
<StackPanel Spacing="22" VerticalAlignment="Center" HorizontalAlignment="Center" MaxWidth="560">
<Grid Width="140" Height="140" HorizontalAlignment="Center">
<Ellipse Classes="pulse" Width="140" Height="140" Fill="{StaticResource BrandRedBrush}" IsVisible="{Binding ShowChecking}" />
<Ellipse Width="112" Height="112" Fill="{StaticResource SurfaceRaisedBrush}" Stroke="{StaticResource LineBrush}" StrokeThickness="2" />
<Ellipse Width="64" Height="64" Fill="{StaticResource GoodBrush}" IsVisible="{Binding ShowOnline}" />
<Ellipse Width="64" Height="64" Fill="{StaticResource BadBrush}" IsVisible="{Binding ShowOffline}" />
<Ellipse Width="64" Height="64" Fill="{StaticResource TextSoftBrush}" Opacity="0.4" IsVisible="{Binding ShowChecking}" />
</Grid>
<TextBlock Classes="status" Text="{Binding StatusFormatted}" />
<TextBlock Classes="lead" Text="{s:Tr AppTagline}" />
<Button Classes="primary" Content="{s:Tr Check}"
AutomationProperties.AutomationId="main-check"
Command="{Binding RefreshCommand}" />
</StackPanel>
</DockPanel>
</UserControl>
+21
View File
@@ -0,0 +1,21 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using MeWeb.App.ViewModels;
namespace MeWeb.App.Views;
public partial class MainView : UserControl
{
public MainView() => InitializeComponent();
protected override void OnLoaded(RoutedEventArgs e)
{
base.OnLoaded(e);
if (DataContext is MainViewModel model)
{
model.Launcher = TopLevel.GetTopLevel(this)?.Launcher;
model.RefreshCommand.Execute(null);
}
}
}
+8
View File
@@ -0,0 +1,8 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="MeWeb.App.Views.MainWindow"
Title="me-web?"
Icon="/Assets/meweb.png"
Width="1100" Height="760" MinWidth="380" MinHeight="560"
Background="{StaticResource GroundBrush}"
WindowStartupLocation="CenterScreen" />
+8
View File
@@ -0,0 +1,8 @@
using Avalonia.Controls;
namespace MeWeb.App.Views;
public partial class MainWindow : Window
{
public MainWindow() => InitializeComponent();
}