-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d6dfe3
commit 774b880
Showing
36 changed files
with
2,084 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
SukiUI.Demo/Features/ControlsLibrary/DockControls/DocumentText.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<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:avaloniaEdit="https://github.com/avaloniaui/avaloniaedit" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="SukiUI.Demo.Features.ControlsLibrary.DockControls.DocumentText"> | ||
<avaloniaEdit:TextEditor Margin="15,15,5,5" Name="Editor" | ||
ShowLineNumbers="True" | ||
/> | ||
</UserControl> |
39 changes: 39 additions & 0 deletions
39
SukiUI.Demo/Features/ControlsLibrary/DockControls/DocumentText.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Markup.Xaml; | ||
using AvaloniaEdit; | ||
using AvaloniaEdit.TextMate; | ||
using TextMateSharp.Grammars; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public partial class DocumentText : UserControl | ||
{ | ||
public DocumentText() | ||
{ | ||
InitializeComponent(); | ||
|
||
|
||
var _textEditor = this.FindControl<TextEditor>("Editor"); | ||
_textEditor.Text = @"<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"" | ||
mc:Ignorable=""d"" d:DesignWidth=""800"" d:DesignHeight=""450"" | ||
x:Class=""SukiUI.Demo.Features.ControlsLibrary.DockView""> | ||
Welcome to Avalonia! | ||
</UserControl> | ||
"; | ||
|
||
//Here we initialize RegistryOptions with the theme we want to use. | ||
var _registryOptions = new RegistryOptions(ThemeName.DarkPlus); | ||
|
||
//Initial setup of TextMate. | ||
var _textMateInstallation = _textEditor.InstallTextMate(_registryOptions); | ||
|
||
//Here we are getting the language by the extension and right after that we are initializing grammar with this language. | ||
//And that's all 😀, you are ready to use AvaloniaEdit with syntax highlighting! | ||
_textMateInstallation.SetGrammar(_registryOptions.GetScopeByLanguageId(_registryOptions.GetLanguageByExtension(".cs").Id)); | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
SukiUI.Demo/Features/ControlsLibrary/DockControls/ErrorList.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<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:controls="clr-namespace:SukiUI.Controls;assembly=SukiUI" | ||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="SukiUI.Demo.Features.ControlsLibrary.DockControls.ErrorList"> | ||
<ScrollViewer Classes="Stack"> | ||
<StackPanel Margin="15,15"> | ||
<StackPanel Orientation="Horizontal" Spacing="12"> | ||
|
||
<controls:GlassCard CornerRadius="10" Padding="12,8"> | ||
<StackPanel Orientation="Horizontal" Spacing="8"> | ||
<avalonia:MaterialIcon Kind="Error" Foreground="Red" Width="16" Height="16" /> | ||
<TextBlock FontWeight="DemiBold" Foreground="{DynamicResource SukiLowText}" Text="2 Errors"></TextBlock> | ||
</StackPanel> | ||
|
||
</controls:GlassCard> | ||
<controls:GlassCard CornerRadius="10" Padding="12,8"> | ||
<StackPanel Orientation="Horizontal" Spacing="8"> | ||
<avalonia:MaterialIcon Kind="WarningCircle" Foreground="Orange" Width="16" Height="16" /> | ||
<TextBlock FontWeight="DemiBold" Foreground="{DynamicResource SukiLowText}" Text="2 Warnings"></TextBlock> | ||
</StackPanel> | ||
|
||
</controls:GlassCard> | ||
<controls:GlassCard CornerRadius="10" Padding="12,8"> | ||
<StackPanel Orientation="Horizontal" Spacing="8"> | ||
<avalonia:MaterialIcon Kind="InformationCircle" Foreground="{DynamicResource SukiPrimaryColor}" Width="16" Height="16" /> | ||
<TextBlock FontWeight="DemiBold" Foreground="{DynamicResource SukiLowText}" Text="0 Messages"></TextBlock> | ||
</StackPanel> | ||
|
||
</controls:GlassCard> | ||
</StackPanel> | ||
|
||
<DataGrid Name="DG" Margin="0,10" AutoGenerateColumns="True"></DataGrid> | ||
</StackPanel> | ||
</ScrollViewer> | ||
</UserControl> |
36 changes: 36 additions & 0 deletions
36
SukiUI.Demo/Features/ControlsLibrary/DockControls/ErrorList.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Collections.ObjectModel; | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Markup.Xaml; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public partial class ErrorList : UserControl | ||
{ | ||
public ErrorList() | ||
{ | ||
InitializeComponent(); | ||
this.Get<DataGrid>("DG").ItemsSource = new ObservableCollection<ErrorD>() | ||
{ | ||
new ErrorD(), | ||
new ErrorD() | ||
{ | ||
Description = "Unused local variable." | ||
}, | ||
new ErrorD() | ||
{ | ||
Description = "Type 'Person' not defined." | ||
}, | ||
}; | ||
} | ||
} | ||
} | ||
|
||
public class ErrorD | ||
{ | ||
public string Code { get; set; } = "BC30230"; | ||
public string Description { get; set; } = "'Inherits' not valid."; | ||
public string Project { get; set; } = "Avalonia.DockDemo"; | ||
public string File { get; set; } = "Program.cs"; | ||
public string Line { get; set; } = "2"; | ||
} |
23 changes: 23 additions & 0 deletions
23
SukiUI.Demo/Features/ControlsLibrary/DockControls/SolutionExplore.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<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:dockControls="clr-namespace:SukiUI.Demo.Features.ControlsLibrary.DockControls" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="SukiUI.Demo.Features.ControlsLibrary.DockControls.SolutionExplore"> | ||
<TreeView x:Name="TV"> | ||
<TreeView.ItemTemplate> | ||
<DataTemplate> | ||
<TreeViewItem Margin="0,-1" HorizontalAlignment="Left" x:DataType="dockControls:FolderItem" ItemsSource="{Binding Children}"> | ||
<TreeViewItem.Header> | ||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> | ||
<avalonia:MaterialIcon Foreground="Gold" IsVisible="{Binding IsDirectory}" Margin="5,0" Kind="Folder" Height="15" Width="15" VerticalAlignment="Center" /> | ||
<TextBlock VerticalAlignment="Center" Text="{Binding Name}" FontWeight="DemiBold" FontSize="13" Foreground="{DynamicResource SukiLowText}"></TextBlock> | ||
</StackPanel> | ||
</TreeViewItem.Header> | ||
</TreeViewItem> | ||
</DataTemplate> | ||
</TreeView.ItemTemplate> | ||
</TreeView> | ||
</UserControl> |
85 changes: 85 additions & 0 deletions
85
SukiUI.Demo/Features/ControlsLibrary/DockControls/SolutionExplore.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.IO; | ||
using System.Linq; | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Markup.Xaml; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls; | ||
|
||
public partial class SolutionExplore : UserControl | ||
{ | ||
public SolutionExplore() | ||
{ | ||
InitializeComponent(); | ||
FolderContents = new ObservableCollection<FolderItem>(); | ||
LoadFolderContents("../"); | ||
this.FindControl<TreeView>("TV").ItemsSource = FolderContents; | ||
} | ||
|
||
public ObservableCollection<FolderItem> FolderContents { get; set; } | ||
|
||
|
||
|
||
private void LoadFolderContents(string path) | ||
{ | ||
var dirInfo = new DirectoryInfo(path); | ||
var files = dirInfo.GetFiles(); | ||
var directories = dirInfo.GetDirectories(); | ||
|
||
foreach (var file in files) | ||
{ | ||
FolderContents.Add(new FolderItem(file.Name, false)); | ||
} | ||
|
||
foreach (var directory in directories) | ||
{ | ||
var folderItem = new FolderItem(directory.Name, true); | ||
LoadFolderContents(directory.FullName); | ||
folderItem.Children = new ObservableCollection<FolderItem>(GetFolderItems(directory.FullName)); | ||
FolderContents.Add(folderItem); | ||
} | ||
|
||
FolderContents = new ObservableCollection<FolderItem>(FolderContents.OrderBy(item => !item.IsDirectory).ThenBy(item => item.Name)); | ||
} | ||
|
||
private IEnumerable<FolderItem> GetFolderItems(string path) | ||
{ | ||
var result = new List<FolderItem>(); | ||
var dirInfo = new DirectoryInfo(path); | ||
var files = dirInfo.GetFiles(); | ||
var directories = dirInfo.GetDirectories(); | ||
|
||
foreach (var file in files) | ||
{ | ||
result.Add(new FolderItem(file.Name, false)); | ||
} | ||
|
||
foreach (var directory in directories) | ||
{ | ||
result.Add(new FolderItem(directory.Name, true)); | ||
} | ||
|
||
return result; | ||
} | ||
} | ||
|
||
|
||
public class FolderItem | ||
{ | ||
public string Name { get; set; } | ||
public bool IsDirectory { get; set; } | ||
public ObservableCollection<FolderItem> Children { get; set; } | ||
|
||
public FolderItem(string name, bool isDirectory) | ||
{ | ||
Name = name; | ||
IsDirectory = isDirectory; | ||
Children = new ObservableCollection<FolderItem>(); | ||
} | ||
} | ||
|
||
|
||
|
||
|
47 changes: 47 additions & 0 deletions
47
SukiUI.Demo/Features/ControlsLibrary/DockControls/propertiesview.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<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:theme="clr-namespace:SukiUI.Theme;assembly=SukiUI" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="SukiUI.Demo.Features.ControlsLibrary.DockControls.propertiesview"> | ||
<StackPanel Margin="15,25,15,0" > | ||
<Expander Header="Window Informations" IsExpanded="True"> | ||
<StackPanel Margin="25,0" Spacing="10"> | ||
<Panel > | ||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Window Title" FontWeight="DemiBold" Foreground="{DynamicResource SukiLowText}"></TextBlock> | ||
<TextBox Margin="0,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Right" Text="Dock Demo"></TextBox> | ||
</Panel> | ||
<Panel> | ||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Height" FontWeight="DemiBold" Foreground="{DynamicResource SukiLowText}"></TextBlock> | ||
<NumericUpDown VerticalAlignment="Center" HorizontalAlignment="Right" Value="800" theme:NumericUpDownExtensions.Unit="px" ShowButtonSpinner="False"></NumericUpDown> | ||
</Panel> | ||
<Panel> | ||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Width" FontWeight="DemiBold" Foreground="{DynamicResource SukiLowText}"></TextBlock> | ||
<NumericUpDown VerticalAlignment="Center" HorizontalAlignment="Right" Value="1200" theme:NumericUpDownExtensions.Unit="px" ShowButtonSpinner="False"></NumericUpDown> | ||
</Panel> | ||
<Panel> | ||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Maximized" FontWeight="DemiBold" Foreground="{DynamicResource SukiLowText}"></TextBlock> | ||
<ToggleSwitch VerticalAlignment="Center" HorizontalAlignment="Right" IsChecked="True"></ToggleSwitch> | ||
</Panel> | ||
</StackPanel> | ||
</Expander> | ||
|
||
<Expander Margin="0,35,0,0" Header="Running State" IsExpanded="True"> | ||
<StackPanel Margin="25,0" Spacing="10"> | ||
|
||
<Panel> | ||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Read Only" FontWeight="DemiBold" Foreground="{DynamicResource SukiLowText}"></TextBlock> | ||
<ToggleSwitch VerticalAlignment="Center" HorizontalAlignment="Right" IsChecked="False"></ToggleSwitch> | ||
</Panel> | ||
|
||
|
||
<Panel> | ||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Running" FontWeight="DemiBold" Foreground="{DynamicResource SukiLowText}"></TextBlock> | ||
<ToggleSwitch VerticalAlignment="Center" HorizontalAlignment="Right" IsChecked="True"></ToggleSwitch> | ||
</Panel> | ||
</StackPanel> | ||
</Expander> | ||
|
||
</StackPanel> | ||
</UserControl> |
14 changes: 14 additions & 0 deletions
14
SukiUI.Demo/Features/ControlsLibrary/DockControls/propertiesview.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Markup.Xaml; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public partial class propertiesview : UserControl | ||
{ | ||
public propertiesview() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
Oops, something went wrong.