diff --git a/.idea/.idea.Blacklight/.idea/avalonia.xml b/.idea/.idea.Blacklight/.idea/avalonia.xml index e6b1c313c19583d1f51862dd7f29fefaa7816eee..2afc772b111054658be9d20a1b66a0b0e812d0d9 100644 --- a/.idea/.idea.Blacklight/.idea/avalonia.xml +++ b/.idea/.idea.Blacklight/.idea/avalonia.xml @@ -24,6 +24,7 @@ <entry key="Blacklight/Views/Utility/MarkdownText.axaml" value="Blacklight.Desktop/Blacklight.Desktop.csproj" /> <entry key="Blacklight/Views/Views/ClientView.axaml" value="Blacklight/Blacklight.csproj" /> <entry key="Blacklight/Views/Views/SettingsView.axaml" value="Blacklight/Blacklight.csproj" /> + <entry key="Blacklight/Views/Windows/CreateChannelWindow.axaml" value="Blacklight.Desktop/Blacklight.Desktop.csproj" /> </map> </option> </component> diff --git a/Avalonia.Labs.Gif/Avalonia.Labs.Gif.csproj b/Avalonia.Labs.Gif/Avalonia.Labs.Gif.csproj index c466e9018bae9e55843d359686a03d71af092e8d..7356e1eccf5d118c49cfdd35e1e578ddd3c26fae 100644 --- a/Avalonia.Labs.Gif/Avalonia.Labs.Gif.csproj +++ b/Avalonia.Labs.Gif/Avalonia.Labs.Gif.csproj @@ -8,8 +8,8 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Avalonia" Version="11.1.3" /> - <PackageReference Include="Avalonia.Skia" Version="11.1.3" /> + <PackageReference Include="Avalonia" Version="11.2.5" /> + <PackageReference Include="Avalonia.Skia" Version="11.2.5" /> </ItemGroup> </Project> diff --git a/Blacklight.Desktop/Blacklight.Desktop.csproj b/Blacklight.Desktop/Blacklight.Desktop.csproj index 59bf3a0bf2072d5d0ca15ac01a9236f7b2c98f60..81b0287ff07f71254d098bef1024130ead8e59e3 100644 --- a/Blacklight.Desktop/Blacklight.Desktop.csproj +++ b/Blacklight.Desktop/Blacklight.Desktop.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <OutputType>WinExe</OutputType> - <TargetFramework>net8.0</TargetFramework> + <TargetFramework>net9.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <AssemblyVersion>1.0.0</AssemblyVersion> @@ -16,9 +16,9 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Avalonia.Desktop" Version="11.1.3" /> + <PackageReference Include="Avalonia.Desktop" Version="11.2.5" /> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> - <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.3" /> + <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.5" /> </ItemGroup> <ItemGroup> diff --git a/Blacklight/App.axaml b/Blacklight/App.axaml index 58766c3c758ccb1f919d13eab159594db250a1e3..2cf90ee42b75875f01df58ca1f6859980bbc9296 100644 --- a/Blacklight/App.axaml +++ b/Blacklight/App.axaml @@ -2,9 +2,6 @@ xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="Blacklight.App" - xmlns:idc="using:Dock.Avalonia.Controls" - xmlns:idcr="using:Dock.Avalonia.Controls.Recycling" - xmlns:ids="using:Dock.Settings" xmlns:local="using:Blacklight" xmlns:controls="clr-namespace:Dock.Model.Controls;assembly=Dock.Model" xmlns:core="clr-namespace:Dock.Model.Core;assembly=Dock.Model" @@ -14,7 +11,7 @@ <!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> <Application.Resources> <ResourceDictionary> - <idcr:ControlRecycling x:Key="ControlRecyclingKey" TryToUseIdAsKey="True" /> + <ControlRecycling x:Key="ControlRecyclingKey" TryToUseIdAsKey="True" /> <util:MessageStatusEnumToColor x:Key="MessageStatusEnumToColor"/> <Color x:Key="RegionColor">Transparent</Color> <ResourceDictionary.ThemeDictionaries> @@ -64,8 +61,8 @@ <Application.Styles> <FluentTheme /> <DockFluentTheme /> - <Style Selector="idc|DockControl"> - <Setter Property="(ids:DockProperties.ControlRecycling)" Value="{StaticResource ControlRecyclingKey}" /> + <Style Selector="DockControl"> + <Setter Property="(ControlRecyclingDataTemplate.ControlRecycling)" Value="{StaticResource ControlRecyclingKey}" /> </Style> diff --git a/Blacklight/Blacklight.csproj b/Blacklight/Blacklight.csproj index 1901658e5cb353a73d3a091eb5eb0bf92393ee3f..f1de52206aaea161451c8a770e153bd810541076 100644 --- a/Blacklight/Blacklight.csproj +++ b/Blacklight/Blacklight.csproj @@ -1,6 +1,6 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net8.0</TargetFramework> + <TargetFramework>net9.0</TargetFramework> <Nullable>enable</Nullable> <BuiltInComInteropSupport>true</BuiltInComInteropSupport> <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault> @@ -12,22 +12,22 @@ <ItemGroup> - <PackageReference Include="Avalonia" Version="11.1.3" /> + <PackageReference Include="Avalonia" Version="11.2.5" /> <PackageReference Include="Avalonia.HtmlRenderer" Version="11.0.0" /> - <PackageReference Include="Avalonia.Svg.Skia" Version="11.1.0.1" /> - <PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.3" /> - <PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.3" /> + <PackageReference Include="Avalonia.Svg.Skia" Version="11.2.0.2" /> + <PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.5" /> + <PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.5" /> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> - <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.3" /> - <PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.1.0.7" /> - <PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" /> - <PackageReference Include="Dock.Avalonia" Version="11.1.0.1" /> - <PackageReference Include="Dock.Model.Mvvm" Version="11.1.0.1" /> - <PackageReference Include="Markdig" Version="0.37.0" /> - <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" /> + <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.5" /> + <PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.2.0.9" /> + <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" /> + <PackageReference Include="Dock.Avalonia" Version="11.2.0" /> + <PackageReference Include="Dock.Model.Mvvm" Version="11.2.0.1" /> + <PackageReference Include="Markdig" Version="0.40.0" /> + <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="ReactiveUI" Version="20.1.63" /> - <PackageReference Include="Serilog" Version="4.0.1" /> + <PackageReference Include="Serilog" Version="4.2.0" /> <PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="6.0.0" /> </ItemGroup> diff --git a/Blacklight/ViewModels/ClientViewModel.cs b/Blacklight/ViewModels/ClientViewModel.cs index efbfd81a33860dd50ba0cca0b8e97c88673eacbf..d852c107ad8cea6befe80b2e0d8a02846c5e1ecb 100644 --- a/Blacklight/ViewModels/ClientViewModel.cs +++ b/Blacklight/ViewModels/ClientViewModel.cs @@ -44,7 +44,6 @@ public class ClientViewModel : ViewModelBase Client = client; DebugFactoryEvents(_factory); - Layout = _factory?.CreateLayout(); if (Layout is { }) { _factory?.InitLayout(Layout); @@ -53,6 +52,7 @@ public class ClientViewModel : ViewModelBase root.Navigate.Execute("Home"); } } + Layout = _factory?.CreateLayout(); NewLayout = new RelayCommand(ResetLayout); Logout = new RelayCommand(LogoutNow); diff --git a/Blacklight/ViewModels/Tools/ResourceExplorerViewModel.cs b/Blacklight/ViewModels/Tools/ResourceExplorerViewModel.cs index 86f8b0d2746388c4bd9f398de17082a99fa85647..59890ce769fd6787828d34c87785e6c04b9a5e64 100644 --- a/Blacklight/ViewModels/Tools/ResourceExplorerViewModel.cs +++ b/Blacklight/ViewModels/Tools/ResourceExplorerViewModel.cs @@ -1,7 +1,55 @@ -using Dock.Model.Mvvm.Controls; +using System; +using Dock.Model.Mvvm.Controls; +using MongoDB.Bson; +using Serilog; namespace Blacklight.ViewModels.Tools; public class ResourceExplorerViewModel : Tool { + public void CreateChannel(object obj) + { + if (obj is not ObjectId quarkId) + { + Log.Information("obj is {Obj}", obj.GetType().FullName); + return; + } + Log.Information("Cats go meow {QuarkId}", quarkId); + + } + + + // ReSharper disable once UnusedMember.Global + public bool CanCreateChannel(object obj) + { + return obj is ObjectId; + } + + public void LeaveQuark(object obj) + { + throw new NotImplementedException(); + } + // ReSharper disable once UnusedMember.Global + public bool CanLeaveQuark(object obj) + { + return true; + } + public void EditQuark(object obj) + { + throw new NotImplementedException(); + } + // ReSharper disable once UnusedMember.Global + public bool CanEditQuark(object obj) + { + return true; + } + public void DeleteQuark(object obj) + { + throw new NotImplementedException(); + } + // ReSharper disable once UnusedMember.Global + public bool CanDeletQuark(object obj) + { + return true; + } } \ No newline at end of file diff --git a/Blacklight/ViewModels/Windows/CreateChannelViewModel.cs b/Blacklight/ViewModels/Windows/CreateChannelViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..436893ad2badf75b1597dc1859f57b66f3676d19 --- /dev/null +++ b/Blacklight/ViewModels/Windows/CreateChannelViewModel.cs @@ -0,0 +1,6 @@ +namespace Blacklight.ViewModels.Windows; + +public class CreateChannelViewModel : ViewModelBase +{ + +} \ No newline at end of file diff --git a/Blacklight/Views/Tools/ResourceExplorerView.axaml b/Blacklight/Views/Tools/ResourceExplorerView.axaml index 87ca236692cd657052f618737cc74b6f789f5413..45bd4d82e7e14fd71303d17bd77492ae52b48006 100644 --- a/Blacklight/Views/Tools/ResourceExplorerView.axaml +++ b/Blacklight/Views/Tools/ResourceExplorerView.axaml @@ -6,6 +6,7 @@ xmlns:views="clr-namespace:Blacklight.Views" xmlns:objects="clr-namespace:Lightquark.NET.Objects;assembly=Lightquark.NET" xmlns:util="clr-namespace:Blacklight.Util" + xmlns:tools="clr-namespace:Blacklight.ViewModels.Tools" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Blacklight.Views.Tools.ResourceExplorerView"> <Grid ColumnDefinitions="*" RowDefinitions="*" Background="{DynamicResource ResourceExplorerColor}"> @@ -13,10 +14,29 @@ <TreeView.DataTemplates> <util:ResourceExplorerTemplateSelector> <TreeDataTemplate x:Key="QuarkTemplate" x:DataType="objects:QuarkListItem" ItemsSource="{Binding Children}"> - <StackPanel Orientation="Horizontal"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch"> <Image Height="32" Margin="0,0,4,0" Source="{Binding Quark.Icon, FallbackValue={x:Static util:StaticFallback.QuarkIcon} }"></Image> <TextBlock VerticalAlignment="Center" Text="{Binding Quark.Name, FallbackValue='No Quark Information'}"></TextBlock> + + <StackPanel.ContextMenu> + <ContextMenu> + <MenuItem Header="Create channel" + Command="{Binding $parent[TreeView].((tools:ResourceExplorerViewModel)DataContext).CreateChannel}" + CommandParameter="{Binding Quark.Id}"/> + + <MenuItem Header="Leave quark" + Command="{Binding $parent[TreeView].((tools:ResourceExplorerViewModel)DataContext).LeaveQuark}" + CommandParameter="{Binding Quark.Id}"/> + <MenuItem Header="Edit quark" + Command="{Binding $parent[TreeView].((tools:ResourceExplorerViewModel)DataContext).EditQuark}" + CommandParameter="{Binding Quark.Id}"/> + <MenuItem Header="Delete quark" + Command="{Binding $parent[TreeView].((tools:ResourceExplorerViewModel)DataContext).DeleteQuark}" + CommandParameter="{Binding Quark.Id}"/> + </ContextMenu> + </StackPanel.ContextMenu> + </StackPanel> </TreeDataTemplate> <TreeDataTemplate x:Key="ChannelTemplate" x:DataType="objects:QuarkListItem"> diff --git a/Blacklight/Views/Windows/CreateChannelView.axaml b/Blacklight/Views/Windows/CreateChannelView.axaml new file mode 100644 index 0000000000000000000000000000000000000000..91d5363aca908c2cdc81cb85976325fdfd626825 --- /dev/null +++ b/Blacklight/Views/Windows/CreateChannelView.axaml @@ -0,0 +1,23 @@ +<Window 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" + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + x:Class="Blacklight.Views.Windows.CreateChannelView" + WindowStartupLocation="CenterScreen" + Title="CreateChannelView"> + <Panel> + <ExperimentalAcrylicBorder IsHitTestVisible="False"> + <ExperimentalAcrylicBorder.Material> + <ExperimentalAcrylicMaterial + BackgroundSource="Digger" + TintColor="Black" + TintOpacity="1" + MaterialOpacity="0.65" /> + </ExperimentalAcrylicBorder.Material> + </ExperimentalAcrylicBorder> + <TextBlock> + Welcome to Avalonia! + </TextBlock> + </Panel> +</Window> \ No newline at end of file diff --git a/Blacklight/Views/Windows/CreateChannelView.axaml.cs b/Blacklight/Views/Windows/CreateChannelView.axaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..f24ee5675eb3ece6f819f3decb4ab84e70eb4899 --- /dev/null +++ b/Blacklight/Views/Windows/CreateChannelView.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Blacklight.Views.Windows; + +public partial class CreateChannelView : Window +{ + public CreateChannelView() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Lightquark.NET/Lightquark.NET.csproj b/Lightquark.NET/Lightquark.NET.csproj index c2faf49800f4cb4ad7bc27254e6c2e540ff1cc0c..af2f5cd29a26d50b6321e19adedd9eeb77b4590a 100644 --- a/Lightquark.NET/Lightquark.NET.csproj +++ b/Lightquark.NET/Lightquark.NET.csproj @@ -7,12 +7,12 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="AutoMapper" Version="13.0.1" /> - <PackageReference Include="Avalonia" Version="11.1.3" /> - <PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" /> + <PackageReference Include="AutoMapper" Version="14.0.0" /> + <PackageReference Include="Avalonia" Version="11.2.5" /> + <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" /> <PackageReference Include="Lightquark.Types" Version="2024.9.15.139" /> - <PackageReference Include="Markdig" Version="0.37.0" /> - <PackageReference Include="Serilog" Version="4.0.1" /> + <PackageReference Include="Markdig" Version="0.40.0" /> + <PackageReference Include="Serilog" Version="4.2.0" /> <PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" /> <PackageReference Include="Websocket.Client" Version="5.1.2" /> </ItemGroup>