committed by
GitHub
160 changed files with 2464 additions and 654 deletions
|
After Width: | Height: | Size: 14 KiB |
@ -1,5 +1,5 @@ |
|||||
<Project> |
<Project> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.0" PrivateAssets="All" /> |
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
</Project> |
</Project> |
||||
|
|||||
Binary file not shown.
@ -0,0 +1,42 @@ |
|||||
|
<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="400" d:DesignHeight="250" |
||||
|
x:Class="ControlCatalog.Pages.LabelsPage" |
||||
|
x:Name="_labelsPage"> |
||||
|
<UserControl.Styles> |
||||
|
<Style Selector="Label"> |
||||
|
<Setter Property="VerticalAlignment" Value="Center"/> |
||||
|
<Setter Property="Margin" Value="6,3,0,3"/> |
||||
|
</Style> |
||||
|
<Style Selector="TextBox"> |
||||
|
<Setter Property="VerticalAlignment" Value="Center"/> |
||||
|
<Setter Property="Margin" Value="0,3,6,3"/> |
||||
|
</Style> |
||||
|
<Style Selector="CheckBox"> |
||||
|
<Setter Property="VerticalAlignment" Value="Center"/> |
||||
|
<Setter Property="Margin" Value="0,3,6,3"/> |
||||
|
</Style> |
||||
|
<Style Selector="Button[IsDefault=true]"> |
||||
|
<Setter Property="Background" Value="{DynamicResource HighlightBrush}"/> |
||||
|
</Style> |
||||
|
</UserControl.Styles> |
||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto" |
||||
|
HorizontalScrollBarVisibility="Hidden"> |
||||
|
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" RowDefinitions="Auto,Auto,Auto,Auto,Auto,*" ColumnDefinitions="Auto,6,*" Width="246"> |
||||
|
<Label Target="{Binding #firstNameEdit}" Grid.Row="0" Grid.Column="0">_First name</Label> |
||||
|
<TextBox Name="firstNameEdit" Grid.Column="2" Grid.Row="0" Text="{Binding FirstName}"></TextBox> |
||||
|
<Label Target="{Binding #lastNameEdit}" Grid.Row="1" Grid.Column="0">_Last name</Label> |
||||
|
<TextBox Name="lastNameEdit" Grid.Column="2" Grid.Row="1" Text="{Binding LastName}"></TextBox> |
||||
|
<Label Target="{Binding #bannedCheck}" Grid.Row="2" Grid.Column="0">_Banned</Label> |
||||
|
<CheckBox Name="bannedCheck" Grid.Column="2" Grid.Row="2" IsChecked="{Binding IsBanned}"></CheckBox> |
||||
|
<GridSplitter Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.RowSpan="3" > |
||||
|
</GridSplitter> |
||||
|
<StackPanel Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="3" Orientation="Horizontal" HorizontalAlignment="Right"> |
||||
|
<Button IsCancel="True" Command="{Binding #_labelsPage.DoCancel}">Cancel</Button> |
||||
|
<Button IsDefault="True" Command="{Binding #_labelsPage.DoSave}">Save</Button> |
||||
|
</StackPanel> |
||||
|
</Grid> |
||||
|
</ScrollViewer> |
||||
|
</UserControl> |
||||
@ -0,0 +1,43 @@ |
|||||
|
using Avalonia; |
||||
|
using Avalonia.Controls; |
||||
|
using Avalonia.Markup.Xaml; |
||||
|
using ControlCatalog.Models; |
||||
|
using ReactiveUI; |
||||
|
|
||||
|
namespace ControlCatalog.Pages |
||||
|
{ |
||||
|
public class LabelsPage : UserControl |
||||
|
{ |
||||
|
private Person _person; |
||||
|
|
||||
|
public LabelsPage() |
||||
|
{ |
||||
|
CreateDefaultPerson(); |
||||
|
this.InitializeComponent(); |
||||
|
} |
||||
|
|
||||
|
private void CreateDefaultPerson() |
||||
|
{ |
||||
|
DataContext = _person = new Person |
||||
|
{ |
||||
|
FirstName = "John", |
||||
|
LastName = "Doe", |
||||
|
IsBanned = true, |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
private void InitializeComponent() |
||||
|
{ |
||||
|
AvaloniaXamlLoader.Load(this); |
||||
|
} |
||||
|
|
||||
|
public void DoSave() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
public void DoCancel() |
||||
|
{ |
||||
|
CreateDefaultPerson(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,13 +1,14 @@ |
|||||
using System; |
using Avalonia; |
||||
using Avalonia; |
|
||||
|
|
||||
namespace Previewer |
namespace Previewer |
||||
{ |
{ |
||||
class Program |
class Program |
||||
{ |
{ |
||||
static void Main(string[] args) |
public static AppBuilder BuildAvaloniaApp() |
||||
{ |
=> AppBuilder.Configure<App>() |
||||
AppBuilder.Configure<App>().UsePlatformDetect().Start<MainWindow>(); |
.UsePlatformDetect(); |
||||
} |
|
||||
|
public static int Main(string[] args) |
||||
|
=> BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,19 +1,17 @@ |
|||||
using System; |
using Avalonia; |
||||
using Avalonia; |
|
||||
using Avalonia.Controls; |
|
||||
using Avalonia.ReactiveUI; |
using Avalonia.ReactiveUI; |
||||
|
|
||||
namespace VirtualizationDemo |
namespace VirtualizationDemo |
||||
{ |
{ |
||||
class Program |
class Program |
||||
{ |
{ |
||||
static void Main(string[] args) |
public static AppBuilder BuildAvaloniaApp() |
||||
{ |
=> AppBuilder.Configure<App>() |
||||
AppBuilder.Configure<App>() |
.UsePlatformDetect() |
||||
.UsePlatformDetect() |
.UseReactiveUI() |
||||
.UseReactiveUI() |
.LogToTrace(); |
||||
.LogToDebug() |
|
||||
.Start<MainWindow>(); |
public static int Main(string[] args) |
||||
} |
=> BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,19 +1,16 @@ |
|||||
using System; |
using Avalonia; |
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Text; |
|
||||
using System.Threading.Tasks; |
|
||||
using Avalonia; |
|
||||
|
|
||||
namespace Direct3DInteropSample |
namespace Direct3DInteropSample |
||||
{ |
{ |
||||
class Program |
class Program |
||||
{ |
{ |
||||
static void Main(string[] args) |
public static AppBuilder BuildAvaloniaApp() |
||||
{ |
=> AppBuilder.Configure<App>() |
||||
AppBuilder.Configure<App>() |
.With(new Win32PlatformOptions { UseDeferredRendering = false }) |
||||
.With(new Win32PlatformOptions {UseDeferredRendering = false}) |
.UseWin32() |
||||
.UseWin32().UseDirect2D1().Start<MainWindow>(); |
.UseDirect2D1(); |
||||
} |
|
||||
|
public static int Main(string[] args) |
||||
|
=> BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,3 +1,4 @@ |
|||||
Compat issues with assembly Avalonia.Base: |
Compat issues with assembly Avalonia.Base: |
||||
CannotAddAbstractMembers : Member 'protected System.IObservable<Avalonia.AvaloniaPropertyChangedEventArgs> Avalonia.AvaloniaProperty.GetChanged()' is abstract in the implementation but is missing in the contract. |
CannotAddAbstractMembers : Member 'protected System.IObservable<Avalonia.AvaloniaPropertyChangedEventArgs> Avalonia.AvaloniaProperty.GetChanged()' is abstract in the implementation but is missing in the contract. |
||||
Total Issues: 1 |
TypesMustExist : Type 'Avalonia.Logging.DebugLogSink' does not exist in the implementation but it does exist in the contract. |
||||
|
Total Issues: 2 |
||||
|
|||||
@ -0,0 +1,39 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace Avalonia.Metadata |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Use to predefine the prefix associated to an xml namespace in a xaml file
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// example:
|
||||
|
/// [assembly: XmlnsPrefix("https://github.com/avaloniaui", "av")]
|
||||
|
/// xaml:
|
||||
|
/// xmlns:av="https://github.com/avaloniaui"
|
||||
|
/// </remarks>
|
||||
|
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] |
||||
|
public sealed class XmlnsPrefixAttribute : Attribute |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Constructor
|
||||
|
/// </summary>
|
||||
|
/// <param name="xmlNamespace">XML namespce</param>
|
||||
|
/// <param name="prefix">recommended prefix</param>
|
||||
|
public XmlnsPrefixAttribute(string xmlNamespace, string prefix) |
||||
|
{ |
||||
|
XmlNamespace = xmlNamespace ?? throw new ArgumentNullException(nameof(xmlNamespace)); |
||||
|
|
||||
|
Prefix = prefix ?? throw new ArgumentNullException(nameof(prefix)); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// XML Namespace
|
||||
|
/// </summary>
|
||||
|
public string XmlNamespace { get; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// New Xml Namespace
|
||||
|
/// </summary>
|
||||
|
public string Prefix { get; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,74 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Runtime.CompilerServices; |
||||
|
using System.Text; |
||||
|
using Avalonia.Controls.Primitives; |
||||
|
using Avalonia.Controls.Templates; |
||||
|
using Avalonia.Data; |
||||
|
using Avalonia.Input; |
||||
|
using Avalonia.Interactivity; |
||||
|
|
||||
|
namespace Avalonia.Controls |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Label control. Focuses <see cref="Target"/> on pointer click or access key press (Alt + accessKey)
|
||||
|
/// </summary>
|
||||
|
public class Label : ContentControl |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Defines the <see cref="Target"/> Direct property
|
||||
|
/// </summary>
|
||||
|
public static readonly DirectProperty<Label, IInputElement> TargetProperty = |
||||
|
AvaloniaProperty.RegisterDirect<Label, IInputElement>(nameof(Target), lbl => lbl.Target, (lbl, inp) => lbl.Target = inp); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Label focus target storage field
|
||||
|
/// </summary>
|
||||
|
private IInputElement _target; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Label focus Target
|
||||
|
/// </summary>
|
||||
|
public IInputElement Target |
||||
|
{ |
||||
|
get => _target; |
||||
|
set => SetAndRaise(TargetProperty, ref _target, value); |
||||
|
} |
||||
|
|
||||
|
static Label() |
||||
|
{ |
||||
|
AccessKeyHandler.AccessKeyPressedEvent.AddClassHandler<Label>((lbl, args) => lbl.LabelActivated(args)); |
||||
|
// IsTabStopProperty.OverrideDefaultValue<Label>(false)
|
||||
|
FocusableProperty.OverrideDefaultValue<Label>(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Initializes instance of <see cref="Label"/> control
|
||||
|
/// </summary>
|
||||
|
public Label() |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Method which focuses <see cref="Target"/> input element
|
||||
|
/// </summary>
|
||||
|
private void LabelActivated(RoutedEventArgs args) |
||||
|
{ |
||||
|
Target?.Focus(); |
||||
|
args.Handled = Target != null; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Handler of <see cref="IInputElement.PointerPressed"/> event
|
||||
|
/// </summary>
|
||||
|
/// <param name="e">Event Arguments</param>
|
||||
|
protected override void OnPointerPressed(PointerPressedEventArgs e) |
||||
|
{ |
||||
|
if (e.GetCurrentPoint(this).Properties.PointerUpdateKind == PointerUpdateKind.LeftButtonPressed) |
||||
|
{ |
||||
|
LabelActivated(e); |
||||
|
} |
||||
|
base.OnPointerPressed(e); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1 @@ |
|||||
|
Total Issues: 0 |
||||
@ -1,7 +1,7 @@ |
|||||
using System.Runtime.CompilerServices; |
using System.Runtime.CompilerServices; |
||||
using Avalonia.Metadata; |
using Avalonia.Metadata; |
||||
|
|
||||
[assembly: InternalsVisibleTo("Avalonia.Layout.UnitTests")] |
[assembly: InternalsVisibleTo("Avalonia.Layout.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c1bba1142285fe0419326fb25866ba62c47e6c2b5c1ab0c95b46413fad375471232cb81706932e1cef38781b9ebd39d5100401bacb651c6c5bbf59e571e81b3bc08d2a622004e08b1a6ece82a7e0b9857525c86d2b95fab4bc3dce148558d7f3ae61aa3a234086902aeface87d9dfdd32b9d2fe3c6dd4055b5ab4b104998bd87")] |
||||
|
|
||||
[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Layout")] |
[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Layout")] |
||||
|
|
||||
|
|||||
@ -0,0 +1,17 @@ |
|||||
|
<Style xmlns="https://github.com/avaloniaui" Selector="Label"> |
||||
|
<Setter Property="Padding" Value="3"/> |
||||
|
<Setter Property="Template"> |
||||
|
<ControlTemplate> |
||||
|
<ContentPresenter Name="PART_ContentPresenter" |
||||
|
Background="{TemplateBinding Background}" |
||||
|
BorderBrush="{TemplateBinding BorderBrush}" |
||||
|
BorderThickness="{TemplateBinding BorderThickness}" |
||||
|
ContentTemplate="{TemplateBinding ContentTemplate}" |
||||
|
Content="{TemplateBinding Content}" |
||||
|
Padding="{TemplateBinding Padding}" |
||||
|
RecognizesAccessKey="True" |
||||
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
||||
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/> |
||||
|
</ControlTemplate> |
||||
|
</Setter> |
||||
|
</Style> |
||||
@ -0,0 +1,17 @@ |
|||||
|
<Style xmlns="https://github.com/avaloniaui" Selector="Label"> |
||||
|
<Setter Property="Padding" Value="3"/> |
||||
|
<Setter Property="Template"> |
||||
|
<ControlTemplate> |
||||
|
<ContentPresenter Name="PART_ContentPresenter" |
||||
|
Background="{TemplateBinding Background}" |
||||
|
BorderBrush="{TemplateBinding BorderBrush}" |
||||
|
BorderThickness="{TemplateBinding BorderThickness}" |
||||
|
ContentTemplate="{TemplateBinding ContentTemplate}" |
||||
|
Content="{TemplateBinding Content}" |
||||
|
Padding="{TemplateBinding Padding}" |
||||
|
RecognizesAccessKey="True" |
||||
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
||||
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/> |
||||
|
</ControlTemplate> |
||||
|
</Setter> |
||||
|
</Style> |
||||
@ -1,11 +1,19 @@ |
|||||
using Avalonia.Platform; |
namespace Avalonia.Media |
||||
|
|
||||
namespace Avalonia.Media |
|
||||
{ |
{ |
||||
|
/// <summary>
|
||||
|
/// Abstract class that describes a 2-D drawing.
|
||||
|
/// </summary>
|
||||
public abstract class Drawing : AvaloniaObject |
public abstract class Drawing : AvaloniaObject |
||||
{ |
{ |
||||
|
/// <summary>
|
||||
|
/// Draws this drawing to the given <see cref="DrawingContext"/>.
|
||||
|
/// </summary>
|
||||
|
/// <param name="context">The drawing context.</param>
|
||||
public abstract void Draw(DrawingContext context); |
public abstract void Draw(DrawingContext context); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Gets the drawing's bounding rectangle.
|
||||
|
/// </summary>
|
||||
public abstract Rect GetBounds(); |
public abstract Rect GetBounds(); |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,4 +1,4 @@ |
|||||
using System.Runtime.CompilerServices; |
using System.Runtime.CompilerServices; |
||||
|
|
||||
[assembly: InternalsVisibleTo("Avalonia.Skia.RenderTests")] |
[assembly: InternalsVisibleTo("Avalonia.Skia.RenderTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c1bba1142285fe0419326fb25866ba62c47e6c2b5c1ab0c95b46413fad375471232cb81706932e1cef38781b9ebd39d5100401bacb651c6c5bbf59e571e81b3bc08d2a622004e08b1a6ece82a7e0b9857525c86d2b95fab4bc3dce148558d7f3ae61aa3a234086902aeface87d9dfdd32b9d2fe3c6dd4055b5ab4b104998bd87")] |
||||
[assembly: InternalsVisibleTo("Avalonia.Skia.UnitTests")] |
[assembly: InternalsVisibleTo("Avalonia.Skia.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c1bba1142285fe0419326fb25866ba62c47e6c2b5c1ab0c95b46413fad375471232cb81706932e1cef38781b9ebd39d5100401bacb651c6c5bbf59e571e81b3bc08d2a622004e08b1a6ece82a7e0b9857525c86d2b95fab4bc3dce148558d7f3ae61aa3a234086902aeface87d9dfdd32b9d2fe3c6dd4055b5ab4b104998bd87")] |
||||
|
|||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue