Skip to content

Commit

Permalink
Creating started
Browse files Browse the repository at this point in the history
  • Loading branch information
Kozlov-AE committed Mar 28, 2023
1 parent 9f76331 commit a33038d
Show file tree
Hide file tree
Showing 12 changed files with 204 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ControlsPreview/App.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ControlsPreview.App">

<Application.Styles>
<SimpleTheme />
</Application.Styles>
</Application>
19 changes: 19 additions & 0 deletions ControlsPreview/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;

namespace ControlsPreview;

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();
}

base.OnFrameworkInitializationCompleted();
}
}
22 changes: 22 additions & 0 deletions ControlsPreview/ControlsPreview.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>

<ItemGroup>
<TrimmerRootAssembly Include="Avalonia.Themes.Fluent" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.0-preview4" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview4" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview4" />
<PackageReference Include="XamlNameReferenceGenerator" Version="1.6.1" />
</ItemGroup>
</Project>
9 changes: 9 additions & 0 deletions ControlsPreview/MainWindow.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<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="ControlsPreview.MainWindow"
Title="ControlsPreview">
Welcome to Avalonia!
</Window>
9 changes: 9 additions & 0 deletions ControlsPreview/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Avalonia.Controls;

namespace ControlsPreview;

public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
}
}
19 changes: 19 additions & 0 deletions ControlsPreview/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Avalonia;
using System;

namespace ControlsPreview;

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()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.LogToTrace();
}
18 changes: 18 additions & 0 deletions ControlsPreview/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- This manifest is used on Windows only.
Don't remove it as it might cause problems with window transparency and embeded controls.
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
<assemblyIdentity version="1.0.0.0" name="AvaloniaTest.Desktop"/>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->

<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>
4 changes: 4 additions & 0 deletions LiteDB.Studio.Cross.Controls/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace LiteDB.Studio.Cross.Controls;

public class Class1 {
}
13 changes: 13 additions & 0 deletions LiteDB.Studio.Cross.Controls/LiteDB.Studio.Cross.Controls.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.0-preview4" />
</ItemGroup>

</Project>
66 changes: 66 additions & 0 deletions LiteDB.Studio.Cross.Controls/TabControl/AddableTabControl.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:tabControl="clr-namespace:LiteDB.Studio.Cross.Controls.TabControl">
<ControlTheme x:Key="{x:Type tabControl:AddableTabControl}"
TargetType="TabControl">
<Setter Property="Padding" Value="8" />
<Setter Property="Template">
<ControlTemplate>
<Border Padding="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<DockPanel>
<StackPanel>
<ItemsPresenter Name="PART_ItemsPresenter"
ItemTemplate="{TemplateBinding ItemTemplate}"
Items="{TemplateBinding Items}"
ItemsPanel="{TemplateBinding ItemsPanel}" />
<Button Name="PART_AddButton"
Content="{TemplateBinding AddButtonContent}" />
</StackPanel>
<ContentPresenter Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding SelectedContent}"
ContentTemplate="{TemplateBinding SelectedContentTemplate}" />
</DockPanel>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^[TabStripPlacement=Top]">
<Setter Property="Padding" Value="0 4 0 0" />
</Style>
<Style Selector="^[TabStripPlacement=Top] /template/ ItemsPresenter#PART_ItemsPresenter">
<Setter Property="DockPanel.Dock" Value="Top" />
</Style>
<Style Selector="^[TabStripPlacement=Bottom] /template/ ItemsPresenter#PART_ItemsPresenter">
<Setter Property="DockPanel.Dock" Value="Bottom" />
</Style>
<Style Selector="^[TabStripPlacement=Bottom]">
<Setter Property="Padding" Value="0 0 0 4" />
</Style>
<Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter">
<Setter Property="DockPanel.Dock" Value="Left" />
</Style>
<Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
<Setter Property="Orientation" Value="Vertical" />
</Style>
<Style Selector="^[TabStripPlacement=Left]">
<Setter Property="Padding" Value="4 0 0 0" />
</Style>
<Style Selector="^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter">
<Setter Property="DockPanel.Dock" Value="Right" />
</Style>
<Style Selector="^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
<Setter Property="Orientation" Value="Vertical" />
</Style>
<Style Selector="^[TabStripPlacement=Right]">
<Setter Property="Padding" Value="0 0 4 0" />
</Style>
</ControlTheme>
</ResourceDictionary>
5 changes: 5 additions & 0 deletions LiteDB.Studio.Cross.Controls/TabControl/AddableTabControl.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace LiteDB.Studio.Cross.Controls.TabControl {
public class AddableTabControl : Avalonia.Controls.TabControl{

}
}
12 changes: 12 additions & 0 deletions LiteDB.Studio.Cross.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiteDB.Studio.Cross.Contrac
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiteDB.Studio.Cross.DbCommunicationV5", "LiteDB.Studio.Cross.DbCommunicationV5\LiteDB.Studio.Cross.DbCommunicationV5.csproj", "{2968D345-BE05-4B09-9CF2-F3DCBD693D6E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlsPreview", "ControlsPreview\ControlsPreview.csproj", "{0525AB74-9F21-4F08-BD82-A2E7311A0BFF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiteDB.Studio.Cross.Controls", "LiteDB.Studio.Cross.Controls\LiteDB.Studio.Cross.Controls.csproj", "{284C125B-448C-4975-80C1-3B0293F14BA5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -43,6 +47,14 @@ Global
{2968D345-BE05-4B09-9CF2-F3DCBD693D6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2968D345-BE05-4B09-9CF2-F3DCBD693D6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2968D345-BE05-4B09-9CF2-F3DCBD693D6E}.Release|Any CPU.Build.0 = Release|Any CPU
{0525AB74-9F21-4F08-BD82-A2E7311A0BFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0525AB74-9F21-4F08-BD82-A2E7311A0BFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0525AB74-9F21-4F08-BD82-A2E7311A0BFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0525AB74-9F21-4F08-BD82-A2E7311A0BFF}.Release|Any CPU.Build.0 = Release|Any CPU
{284C125B-448C-4975-80C1-3B0293F14BA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{284C125B-448C-4975-80C1-3B0293F14BA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{284C125B-448C-4975-80C1-3B0293F14BA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{284C125B-448C-4975-80C1-3B0293F14BA5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit a33038d

Please sign in to comment.