commit c783e9fb9c395d806e90c063adb12e8294a68e74
Author: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com>
Date: Fri Feb 27 00:27:08 2026 +0100
Initial commit
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..dfe0770
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+# Auto detect text files and perform LF normalization
+* text=auto
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..93df31b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,401 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+# but not Directory.Build.rsp, as it configures directory-level build defaults
+!Directory.Build.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.tlog
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
+*.vbp
+
+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
+*.dsw
+*.dsp
+
+# Visual Studio 6 technical files
+*.ncb
+*.aps
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# Visual Studio History (VSHistory) files
+.vshistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
+
+# VS Code files for those working on multiple tools
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# Local History for Visual Studio Code
+.history/
+
+# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# JetBrains Rider
+*.sln.iml
diff --git a/Decho.slnx b/Decho.slnx
new file mode 100644
index 0000000..5c0a71e
--- /dev/null
+++ b/Decho.slnx
@@ -0,0 +1,3 @@
+
+
+
diff --git a/Decho/App.axaml b/Decho/App.axaml
new file mode 100644
index 0000000..2439a53
--- /dev/null
+++ b/Decho/App.axaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Decho/App.axaml.cs b/Decho/App.axaml.cs
new file mode 100644
index 0000000..2c85eda
--- /dev/null
+++ b/Decho/App.axaml.cs
@@ -0,0 +1,30 @@
+using Avalonia;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Markup.Xaml;
+
+using Decho.ViewModels;
+using Decho.Views;
+
+namespace Decho;
+
+public partial class App : Application
+{
+ public override void Initialize()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ public override void OnFrameworkInitializationCompleted()
+ {
+ if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
+ {
+ desktop.MainWindow = new MainWindow
+ {
+ DataContext = new MainWindowViewModel(),
+ };
+ }
+
+ base.OnFrameworkInitializationCompleted();
+ }
+
+}
\ No newline at end of file
diff --git a/Decho/Assets/avalonia-logo.ico b/Decho/Assets/avalonia-logo.ico
new file mode 100644
index 0000000..f7da8bb
Binary files /dev/null and b/Decho/Assets/avalonia-logo.ico differ
diff --git a/Decho/Decho.csproj b/Decho/Decho.csproj
new file mode 100644
index 0000000..ba5ea85
--- /dev/null
+++ b/Decho/Decho.csproj
@@ -0,0 +1,29 @@
+
+
+ WinExe
+ net10.0
+ enable
+ app.manifest
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ None
+ All
+
+
+
+
+
+
diff --git a/Decho/Models/ChannelModel.cs b/Decho/Models/ChannelModel.cs
new file mode 100644
index 0000000..dd72e12
--- /dev/null
+++ b/Decho/Models/ChannelModel.cs
@@ -0,0 +1,19 @@
+using System.Collections.ObjectModel;
+
+namespace Decho.Models;
+
+public sealed class ChannelModel
+{
+ public ChannelModel(string id, string name, ObservableCollection messages)
+ {
+ Id = id;
+ Name = name;
+ Messages = messages;
+ }
+
+ public string Id { get; }
+
+ public string Name { get; }
+
+ public ObservableCollection Messages { get; }
+}
diff --git a/Decho/Models/MessageModel.cs b/Decho/Models/MessageModel.cs
new file mode 100644
index 0000000..0822ba0
--- /dev/null
+++ b/Decho/Models/MessageModel.cs
@@ -0,0 +1,22 @@
+using System;
+
+namespace Decho.Models;
+
+public sealed class MessageModel
+{
+ public MessageModel(string id, UserModel author, DateTimeOffset sentAt, string content)
+ {
+ Id = id;
+ Author = author;
+ SentAt = sentAt;
+ Content = content;
+ }
+
+ public string Id { get; }
+
+ public UserModel Author { get; }
+
+ public DateTimeOffset SentAt { get; }
+
+ public string Content { get; }
+}
diff --git a/Decho/Models/ServerModel.cs b/Decho/Models/ServerModel.cs
new file mode 100644
index 0000000..86509e2
--- /dev/null
+++ b/Decho/Models/ServerModel.cs
@@ -0,0 +1,19 @@
+using System.Collections.ObjectModel;
+
+namespace Decho.Models;
+
+public sealed class ServerModel
+{
+ public ServerModel(string id, string name, ObservableCollection channels)
+ {
+ Id = id;
+ Name = name;
+ Channels = channels;
+ }
+
+ public string Id { get; }
+
+ public string Name { get; }
+
+ public ObservableCollection Channels { get; }
+}
diff --git a/Decho/Models/UserModel.cs b/Decho/Models/UserModel.cs
new file mode 100644
index 0000000..6d8f328
--- /dev/null
+++ b/Decho/Models/UserModel.cs
@@ -0,0 +1,14 @@
+namespace Decho.Models;
+
+public sealed class UserModel
+{
+ public UserModel(string id, string displayName)
+ {
+ Id = id;
+ DisplayName = displayName;
+ }
+
+ public string Id { get; }
+
+ public string DisplayName { get; }
+}
diff --git a/Decho/Program.cs b/Decho/Program.cs
new file mode 100644
index 0000000..9b6a31a
--- /dev/null
+++ b/Decho/Program.cs
@@ -0,0 +1,34 @@
+global using ReactiveUI;
+global using ReactiveUI.Avalonia;
+
+using Avalonia;
+
+using Projektanker.Icons.Avalonia;
+using Projektanker.Icons.Avalonia.FontAwesome;
+
+using System;
+
+namespace Decho;
+
+internal sealed class Program
+{
+ // Initialization code. Don't use any Avalonia, third-party APIs or any
+ // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
+ // yet and stuff might break.
+ [STAThread]
+ public static void Main(string[] args) => BuildAvaloniaApp()
+ .StartWithClassicDesktopLifetime(args);
+
+ // Avalonia configuration, don't remove; also used by visual designer.
+ public static AppBuilder BuildAvaloniaApp()
+ {
+ IconProvider.Current
+ .Register();
+
+ return AppBuilder.Configure()
+ .UsePlatformDetect()
+ .WithInterFont()
+ .LogToTrace()
+ .UseReactiveUI();
+ }
+}
diff --git a/Decho/ViewLocator.cs b/Decho/ViewLocator.cs
new file mode 100644
index 0000000..36bcb58
--- /dev/null
+++ b/Decho/ViewLocator.cs
@@ -0,0 +1,38 @@
+using Avalonia.Controls;
+using Avalonia.Controls.Templates;
+
+using Decho.ViewModels;
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+
+namespace Decho;
+///
+/// Given a view model, returns the corresponding view if possible.
+///
+[RequiresUnreferencedCode(
+ "Default implementation of ViewLocator involves reflection which may be trimmed away.",
+ Url = "https://docs.avaloniaui.net/docs/concepts/view-locator")]
+public class ViewLocator : IDataTemplate
+{
+ public Control? Build(object? param)
+ {
+ if (param is null)
+ return null;
+
+ var name = param.GetType().FullName!.Replace("ViewModel", "View", StringComparison.Ordinal);
+ var type = Type.GetType(name);
+
+ if (type != null)
+ {
+ return (Control)Activator.CreateInstance(type)!;
+ }
+
+ return new TextBlock { Text = "Not Found: " + name };
+ }
+
+ public bool Match(object? data)
+ {
+ return data is ViewModelBase;
+ }
+}
diff --git a/Decho/ViewModels/ChannelViewModel.cs b/Decho/ViewModels/ChannelViewModel.cs
new file mode 100644
index 0000000..f183dde
--- /dev/null
+++ b/Decho/ViewModels/ChannelViewModel.cs
@@ -0,0 +1,28 @@
+using System.Collections.ObjectModel;
+using System.Linq;
+
+using Decho.Models;
+
+namespace Decho.ViewModels;
+
+public sealed class ChannelViewModel : ViewModelBase
+{
+ public ChannelViewModel(ChannelModel model)
+ {
+ Model = model;
+ Messages = new ObservableCollection(
+ model.Messages.Select(message => new MessageViewModel(message)));
+ }
+
+ public ChannelModel Model { get; }
+
+ public string Name => Model.Name;
+
+ public ObservableCollection Messages { get; }
+
+ public void AddMessage(MessageModel message)
+ {
+ Model.Messages.Add(message);
+ Messages.Add(new MessageViewModel(message));
+ }
+}
diff --git a/Decho/ViewModels/ChatViewModel.cs b/Decho/ViewModels/ChatViewModel.cs
new file mode 100644
index 0000000..74f7587
--- /dev/null
+++ b/Decho/ViewModels/ChatViewModel.cs
@@ -0,0 +1,41 @@
+using System.Collections.ObjectModel;
+
+namespace Decho.ViewModels;
+
+public sealed class ChatViewModel : ViewModelBase
+{
+ private ObservableCollection _messages = new();
+ private string _channelTitle = "Select a channel";
+
+ public ChatViewModel()
+ {
+ Composer = new MessageComposerViewModel();
+ }
+
+ public ObservableCollection Messages
+ {
+ get => _messages;
+ private set => this.RaiseAndSetIfChanged(ref _messages, value);
+ }
+
+ public string ChannelTitle
+ {
+ get => _channelTitle;
+ private set => this.RaiseAndSetIfChanged(ref _channelTitle, value);
+ }
+
+ public MessageComposerViewModel Composer { get; }
+
+ public void SetChannel(ChannelViewModel? channel)
+ {
+ if (channel is null)
+ {
+ Messages = new ObservableCollection();
+ ChannelTitle = "Select a channel";
+ return;
+ }
+
+ Messages = channel.Messages;
+ ChannelTitle = "#" + channel.Name;
+ }
+}
diff --git a/Decho/ViewModels/MainWindowViewModel.cs b/Decho/ViewModels/MainWindowViewModel.cs
new file mode 100644
index 0000000..e1bfb37
--- /dev/null
+++ b/Decho/ViewModels/MainWindowViewModel.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Reactive.Linq;
+
+using Decho.Models;
+using ReactiveUI;
+
+namespace Decho.ViewModels;
+
+public sealed class MainWindowViewModel : ViewModelBase
+{
+ private readonly UserModel _currentUser;
+
+ public string Title { get; } = "Decho";
+
+ public SidebarViewModel Sidebar { get; }
+
+ public ChatViewModel Chat { get; }
+
+ public MainWindowViewModel()
+ {
+ _currentUser = new UserModel("user-1", "You");
+
+ var servers = SeedServers();
+ Sidebar = new SidebarViewModel(servers);
+ Chat = new ChatViewModel();
+
+ Sidebar.WhenAnyValue(x => x.SelectedChannel)
+ .Subscribe(channel => Chat.SetChannel(channel));
+
+ Chat.Composer.SendRequested += HandleSendRequested;
+
+ if (Sidebar.SelectedChannel is not null)
+ Chat.SetChannel(Sidebar.SelectedChannel);
+ }
+
+ private void HandleSendRequested(string text)
+ {
+ if (Sidebar.SelectedChannel is null)
+ return;
+
+ var message = new MessageModel(
+ Guid.NewGuid().ToString("N"),
+ _currentUser,
+ DateTimeOffset.Now,
+ text);
+
+ Sidebar.SelectedChannel.AddMessage(message);
+ }
+
+ private static IReadOnlyList SeedServers()
+ {
+ var alex = new UserModel("user-2", "Alex");
+ var sam = new UserModel("user-3", "Sam");
+
+ var general = new ChannelModel(
+ "channel-1",
+ "general",
+ new ObservableCollection
+ {
+ new("message-1", alex, DateTimeOffset.Now.AddMinutes(-30), "This is a message."),
+ new("message-2", sam, DateTimeOffset.Now.AddMinutes(-25), "Another message for the channel."),
+ new("message-3", alex, DateTimeOffset.Now.AddMinutes(-10), "We should test the new layout."),
+ });
+
+ var random = new ChannelModel(
+ "channel-2",
+ "random",
+ new ObservableCollection
+ {
+ new("message-4", sam, DateTimeOffset.Now.AddMinutes(-5), "Random chat keeps the vibe light."),
+ });
+
+ var music = new ChannelModel(
+ "channel-3",
+ "music",
+ new ObservableCollection());
+
+ var server = new ServerModel(
+ "server-1",
+ "Server",
+ new ObservableCollection { general, random });
+
+ var anotherServer = new ServerModel(
+ "server-2",
+ "Another Server",
+ new ObservableCollection() { general, music});
+
+ return new[] { server, anotherServer };
+ }
+}
diff --git a/Decho/ViewModels/MessageComposerViewModel.cs b/Decho/ViewModels/MessageComposerViewModel.cs
new file mode 100644
index 0000000..e298535
--- /dev/null
+++ b/Decho/ViewModels/MessageComposerViewModel.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Reactive;
+using System.Reactive.Linq;
+
+using ReactiveUI;
+
+namespace Decho.ViewModels;
+
+public sealed class MessageComposerViewModel : ViewModelBase
+{
+ private string _draft = string.Empty;
+
+ public MessageComposerViewModel()
+ {
+ var canSend = this.WhenAnyValue(x => x.Draft, draft => !string.IsNullOrWhiteSpace(draft));
+ SendCommand = ReactiveCommand.Create(Send, canSend);
+ }
+
+ public string Draft
+ {
+ get => _draft;
+ set => this.RaiseAndSetIfChanged(ref _draft, value);
+ }
+
+ public ReactiveCommand SendCommand { get; }
+
+ public event Action? SendRequested;
+
+ private void Send()
+ {
+ var text = Draft.Trim();
+ if (string.IsNullOrWhiteSpace(text))
+ return;
+
+ Draft = string.Empty;
+ SendRequested?.Invoke(text);
+ }
+}
diff --git a/Decho/ViewModels/MessageViewModel.cs b/Decho/ViewModels/MessageViewModel.cs
new file mode 100644
index 0000000..b878f3a
--- /dev/null
+++ b/Decho/ViewModels/MessageViewModel.cs
@@ -0,0 +1,19 @@
+using Decho.Models;
+
+namespace Decho.ViewModels;
+
+public sealed class MessageViewModel : ViewModelBase
+{
+ public MessageViewModel(MessageModel model)
+ {
+ Model = model;
+ }
+
+ public MessageModel Model { get; }
+
+ public string AuthorName => Model.Author.DisplayName;
+
+ public string Content => Model.Content;
+
+ public string TimeText => Model.SentAt.ToLocalTime().ToString("h:mm tt");
+}
diff --git a/Decho/ViewModels/ServerViewModel.cs b/Decho/ViewModels/ServerViewModel.cs
new file mode 100644
index 0000000..d0be4b7
--- /dev/null
+++ b/Decho/ViewModels/ServerViewModel.cs
@@ -0,0 +1,37 @@
+using System.Collections.ObjectModel;
+using System.Linq;
+
+using Decho.Models;
+
+namespace Decho.ViewModels;
+
+public sealed class ServerViewModel : ViewModelBase
+{
+ private bool _isExpanded = true;
+ private ChannelViewModel? _selectedChannel;
+
+ public ServerViewModel(ServerModel model)
+ {
+ Model = model;
+ Channels = new ObservableCollection(
+ model.Channels.Select(channel => new ChannelViewModel(channel)));
+ }
+
+ public ServerModel Model { get; }
+
+ public string Name => Model.Name;
+
+ public ObservableCollection Channels { get; }
+
+ public ChannelViewModel? SelectedChannel
+ {
+ get => _selectedChannel;
+ set => this.RaiseAndSetIfChanged(ref _selectedChannel, value);
+ }
+
+ public bool IsExpanded
+ {
+ get => _isExpanded;
+ set => this.RaiseAndSetIfChanged(ref _isExpanded, value);
+ }
+}
diff --git a/Decho/ViewModels/SidebarViewModel.cs b/Decho/ViewModels/SidebarViewModel.cs
new file mode 100644
index 0000000..a75e7a7
--- /dev/null
+++ b/Decho/ViewModels/SidebarViewModel.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Reactive.Linq;
+
+using Decho.Models;
+using ReactiveUI;
+
+namespace Decho.ViewModels;
+
+public sealed class SidebarViewModel : ViewModelBase
+{
+ private ChannelViewModel? _selectedChannel;
+
+ public SidebarViewModel(IEnumerable servers)
+ {
+ Servers = new ObservableCollection(
+ servers.Select(server => new ServerViewModel(server)));
+ SelectedChannel = Servers.FirstOrDefault()?.Channels.FirstOrDefault();
+
+ foreach (var server in Servers)
+ {
+ server.WhenAnyValue(s => s.SelectedChannel)
+ .Where(channel => channel is not null)
+ .Subscribe(new Action(channel => SelectedChannel = channel!));
+ }
+ }
+
+ public ObservableCollection Servers { get; }
+
+ public ChannelViewModel? SelectedChannel
+ {
+ get => _selectedChannel;
+ set
+ {
+ if (ReferenceEquals(_selectedChannel, value))
+ return;
+
+ this.RaiseAndSetIfChanged(ref _selectedChannel, value);
+
+ if (value is null)
+ return;
+
+ foreach (var server in Servers)
+ {
+ if (server.Channels.Contains(value))
+ {
+ if (!ReferenceEquals(server.SelectedChannel, value))
+ server.SelectedChannel = value;
+ }
+ else if (server.SelectedChannel is not null)
+ {
+ server.SelectedChannel = null;
+ }
+ }
+ }
+ }
+}
diff --git a/Decho/ViewModels/ViewModelBase.cs b/Decho/ViewModels/ViewModelBase.cs
new file mode 100644
index 0000000..0849b40
--- /dev/null
+++ b/Decho/ViewModels/ViewModelBase.cs
@@ -0,0 +1,7 @@
+using ReactiveUI;
+
+namespace Decho.ViewModels;
+
+public abstract class ViewModelBase : ReactiveObject
+{
+}
diff --git a/Decho/Views/ChannelListView.axaml b/Decho/Views/ChannelListView.axaml
new file mode 100644
index 0000000..21b7d5b
--- /dev/null
+++ b/Decho/Views/ChannelListView.axaml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Decho/Views/ChannelListView.axaml.cs b/Decho/Views/ChannelListView.axaml.cs
new file mode 100644
index 0000000..bad7c1e
--- /dev/null
+++ b/Decho/Views/ChannelListView.axaml.cs
@@ -0,0 +1,11 @@
+using Avalonia.Controls;
+
+namespace Decho.Views;
+
+public partial class ChannelListView : UserControl
+{
+ public ChannelListView()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/Decho/Views/ChatView.axaml b/Decho/Views/ChatView.axaml
new file mode 100644
index 0000000..25a81b9
--- /dev/null
+++ b/Decho/Views/ChatView.axaml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
diff --git a/Decho/Views/ChatView.axaml.cs b/Decho/Views/ChatView.axaml.cs
new file mode 100644
index 0000000..ade7e9a
--- /dev/null
+++ b/Decho/Views/ChatView.axaml.cs
@@ -0,0 +1,11 @@
+using Avalonia.Controls;
+
+namespace Decho.Views;
+
+public partial class ChatView : UserControl
+{
+ public ChatView()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/Decho/Views/MainWindow.axaml b/Decho/Views/MainWindow.axaml
new file mode 100644
index 0000000..6ac37e9
--- /dev/null
+++ b/Decho/Views/MainWindow.axaml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Decho/Views/MainWindow.axaml.cs b/Decho/Views/MainWindow.axaml.cs
new file mode 100644
index 0000000..5eccf03
--- /dev/null
+++ b/Decho/Views/MainWindow.axaml.cs
@@ -0,0 +1,11 @@
+using Avalonia.Controls;
+
+namespace Decho.Views;
+
+public partial class MainWindow : Window
+{
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/Decho/Views/MessageComposerView.axaml b/Decho/Views/MessageComposerView.axaml
new file mode 100644
index 0000000..a6cb502
--- /dev/null
+++ b/Decho/Views/MessageComposerView.axaml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
diff --git a/Decho/Views/MessageComposerView.axaml.cs b/Decho/Views/MessageComposerView.axaml.cs
new file mode 100644
index 0000000..dc80d72
--- /dev/null
+++ b/Decho/Views/MessageComposerView.axaml.cs
@@ -0,0 +1,11 @@
+using Avalonia.Controls;
+
+namespace Decho.Views;
+
+public partial class MessageComposerView : UserControl
+{
+ public MessageComposerView()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/Decho/Views/MessageItemView.axaml b/Decho/Views/MessageItemView.axaml
new file mode 100644
index 0000000..e4c52f5
--- /dev/null
+++ b/Decho/Views/MessageItemView.axaml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
diff --git a/Decho/Views/MessageItemView.axaml.cs b/Decho/Views/MessageItemView.axaml.cs
new file mode 100644
index 0000000..15cd9fd
--- /dev/null
+++ b/Decho/Views/MessageItemView.axaml.cs
@@ -0,0 +1,11 @@
+using Avalonia.Controls;
+
+namespace Decho.Views;
+
+public partial class MessageItemView : UserControl
+{
+ public MessageItemView()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/Decho/Views/MessageListView.axaml b/Decho/Views/MessageListView.axaml
new file mode 100644
index 0000000..23005c0
--- /dev/null
+++ b/Decho/Views/MessageListView.axaml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Decho/Views/MessageListView.axaml.cs b/Decho/Views/MessageListView.axaml.cs
new file mode 100644
index 0000000..7bdac3e
--- /dev/null
+++ b/Decho/Views/MessageListView.axaml.cs
@@ -0,0 +1,11 @@
+using Avalonia.Controls;
+
+namespace Decho.Views;
+
+public partial class MessageListView : UserControl
+{
+ public MessageListView()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/Decho/Views/SidebarView.axaml b/Decho/Views/SidebarView.axaml
new file mode 100644
index 0000000..1c31903
--- /dev/null
+++ b/Decho/Views/SidebarView.axaml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Decho/Views/SidebarView.axaml.cs b/Decho/Views/SidebarView.axaml.cs
new file mode 100644
index 0000000..657486f
--- /dev/null
+++ b/Decho/Views/SidebarView.axaml.cs
@@ -0,0 +1,25 @@
+using Avalonia;
+using Avalonia.Controls;
+
+using Decho.ViewModels;
+
+namespace Decho.Views;
+
+public partial class SidebarView : UserControl
+{
+ public static readonly StyledProperty SelectedChannelProperty =
+ AvaloniaProperty.Register(
+ nameof(SelectedChannel),
+ defaultBindingMode: Avalonia.Data.BindingMode.TwoWay);
+
+ public SidebarView()
+ {
+ InitializeComponent();
+ }
+
+ public ChannelViewModel? SelectedChannel
+ {
+ get => GetValue(SelectedChannelProperty);
+ set => SetValue(SelectedChannelProperty, value);
+ }
+}
diff --git a/Decho/app.manifest b/Decho/app.manifest
new file mode 100644
index 0000000..83936d4
--- /dev/null
+++ b/Decho/app.manifest
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..fd5b5d2
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 Stone_Red
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..1c27382
--- /dev/null
+++ b/README.md
@@ -0,0 +1,2 @@
+# Decho
+