30 changed files with 301 additions and 165 deletions
@ -1,5 +0,0 @@ |
|||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
||||
<ItemGroup> |
|
||||
<PackageReference Include="reactiveui" Version="8.0.0-alpha0034" /> |
|
||||
</ItemGroup> |
|
||||
</Project> |
|
||||
@ -1,10 +1,11 @@ |
|||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<PackageReference Include="System.Reactive" Version="3.1.0" /> |
<PackageReference Include="System.Reactive" Version="3.0.0" /> |
||||
<PackageReference Include="System.Reactive.Core" Version="3.1.0" /> |
<PackageReference Include="System.Reactive.Core" Version="3.0.0" /> |
||||
<PackageReference Include="System.Reactive.Interfaces" Version="3.1.0" /> |
<PackageReference Include="System.Reactive.Interfaces" Version="3.0.0" /> |
||||
<PackageReference Include="System.Reactive.Linq" Version="3.1.0" /> |
<PackageReference Include="System.Reactive.Linq" Version="3.0.0" /> |
||||
<PackageReference Include="System.Reactive.PlatformServices" Version="3.1.0" /> |
<PackageReference Include="System.Reactive.PlatformServices" Version="3.0.0" /> |
||||
<PackageReference Condition="$(TargetFramework.StartsWith('net4'))" Include="System.Reactive.Windows.Threading" Version="3.1.0" /> |
<PackageReference Condition="'$(TargetFramework)' == 'net45'" Include="System.Reactive.Windows.Threading" Version="3.0.0" /> |
||||
|
<PackageReference Condition="'$(TargetFramework)' == 'net461'" Include="System.Reactive.Windows.Threading" Version="3.0.0" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
</Project> |
</Project> |
||||
|
|||||
@ -0,0 +1,36 @@ |
|||||
|
<UserControl xmlns="https://github.com/avaloniaui"> |
||||
|
<StackPanel Orientation="Vertical" Gap="4"> |
||||
|
<TextBlock Classes="h1">Context Menu</TextBlock> |
||||
|
<TextBlock Classes="h2">A right click menu that can be applied to any control.</TextBlock> |
||||
|
|
||||
|
<StackPanel Orientation="Horizontal" |
||||
|
Margin="0,16,0,0" |
||||
|
HorizontalAlignment="Center" |
||||
|
Gap="16"> |
||||
|
<Border Background="{StyleResource ThemeAccentBrush}" |
||||
|
Padding="48,48,48,48"> |
||||
|
<Border.ContextMenu> |
||||
|
<ContextMenu> |
||||
|
<MenuItem Header="Standard _Menu Item"/> |
||||
|
<Separator/> |
||||
|
<MenuItem Header="Menu with _Submenu"> |
||||
|
<MenuItem Header="Submenu _1"/> |
||||
|
<MenuItem Header="Submenu _2"/> |
||||
|
</MenuItem> |
||||
|
<MenuItem Header="Menu Item with _Icon"> |
||||
|
<MenuItem.Icon> |
||||
|
<Image Source="resm:ControlCatalog.Assets.github_icon.png"/> |
||||
|
</MenuItem.Icon> |
||||
|
</MenuItem> |
||||
|
<MenuItem Header="Menu Item with _Checkbox"> |
||||
|
<MenuItem.Icon> |
||||
|
<CheckBox BorderThickness="0" IsHitTestVisible="False" IsChecked="True"/> |
||||
|
</MenuItem.Icon> |
||||
|
</MenuItem> |
||||
|
</ContextMenu> |
||||
|
</Border.ContextMenu> |
||||
|
<TextBlock Text="Right Click Here"/> |
||||
|
</Border> |
||||
|
</StackPanel> |
||||
|
</StackPanel> |
||||
|
</UserControl> |
||||
@ -0,0 +1,18 @@ |
|||||
|
using Avalonia.Controls; |
||||
|
using Avalonia.Markup.Xaml; |
||||
|
|
||||
|
namespace ControlCatalog.Pages |
||||
|
{ |
||||
|
public class ContextMenuPage : UserControl |
||||
|
{ |
||||
|
public ContextMenuPage() |
||||
|
{ |
||||
|
this.InitializeComponent(); |
||||
|
} |
||||
|
|
||||
|
private void InitializeComponent() |
||||
|
{ |
||||
|
AvaloniaXamlLoader.Load(this); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,5 +1,5 @@ |
|||||
copy ..\samples\ControlCatalog.NetCore\bin\Debug\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia\$args\lib\netcoreapp1.0\ |
copy ..\samples\ControlCatalog.NetCore\bin\Debug\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia\$args\lib\netcoreapp1.0\ |
||||
copy ..\samples\ControlCatalog.NetCore.\bin\Debug\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia\$args\lib\netstandard1.1\ |
copy ..\samples\ControlCatalog.NetCore.\bin\Debug\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia\$args\lib\netstandard1.3\ |
||||
copy ..\samples\ControlCatalog.NetCore.\bin\Debug\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia.gtk3\$args\lib\netstandard1.1\ |
copy ..\samples\ControlCatalog.NetCore.\bin\Debug\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia.gtk3\$args\lib\netstandard1.3\ |
||||
copy ..\samples\ControlCatalog.NetCore.\bin\Debug\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia.skia.desktop\$args\lib\netstandard1.3\ |
copy ..\samples\ControlCatalog.NetCore.\bin\Debug\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia.skia.desktop\$args\lib\netstandard1.3\ |
||||
copy ..\samples\ControlCatalog.NetCore.\bin\Debug\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia.win32\$args\lib\netstandard1.1\ |
copy ..\samples\ControlCatalog.NetCore.\bin\Debug\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia.win32\$args\lib\netstandard1.3\ |
||||
|
|||||
@ -0,0 +1,5 @@ |
|||||
|
copy ..\samples\ControlCatalog.NetCore\bin\Release\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia\$args\lib\netcoreapp1.0\ |
||||
|
copy ..\samples\ControlCatalog.NetCore.\bin\Release\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia\$args\lib\netstandard1.3\ |
||||
|
copy ..\samples\ControlCatalog.NetCore.\bin\Release\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia.gtk3\$args\lib\netstandard1.3\ |
||||
|
copy ..\samples\ControlCatalog.NetCore.\bin\Release\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia.skia.desktop\$args\lib\netstandard1.3\ |
||||
|
copy ..\samples\ControlCatalog.NetCore.\bin\Release\netcoreapp1.1\Avalonia**.dll ~\.nuget\packages\avalonia.win32\$args\lib\netstandard1.3\ |
||||
@ -1,24 +0,0 @@ |
|||||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|
||||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|
||||
|
|
||||
using Avalonia.Controls; |
|
||||
using Avalonia.Threading; |
|
||||
using ReactiveUI; |
|
||||
using System; |
|
||||
using System.Reactive.Concurrency; |
|
||||
using System.Threading; |
|
||||
|
|
||||
namespace Avalonia |
|
||||
{ |
|
||||
public static class AppBuilderExtensions |
|
||||
{ |
|
||||
public static TAppBuilder UseReactiveUI<TAppBuilder>(this TAppBuilder builder) |
|
||||
where TAppBuilder : AppBuilderBase<TAppBuilder>, new() |
|
||||
{ |
|
||||
return builder.AfterSetup(_ => |
|
||||
{ |
|
||||
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance; |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,6 +1,33 @@ |
|||||
// Copyright (c) The Avalonia Project. All rights reserved.
|
// Copyright (c) The Avalonia Project. All rights reserved.
|
||||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
||||
|
|
||||
|
using System.Resources; |
||||
using System.Reflection; |
using System.Reflection; |
||||
|
using System.Runtime.CompilerServices; |
||||
|
using System.Runtime.InteropServices; |
||||
|
|
||||
|
// General Information about an assembly is controlled through the following
|
||||
|
// set of attributes. Change these attribute values to modify the information
|
||||
|
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Avalonia.ReactiveUI")] |
[assembly: AssemblyTitle("Avalonia.ReactiveUI")] |
||||
|
[assembly: AssemblyDescription("")] |
||||
|
[assembly: AssemblyConfiguration("")] |
||||
|
[assembly: AssemblyCompany("")] |
||||
|
[assembly: AssemblyProduct("Avalonia.ReactiveUI")] |
||||
|
[assembly: AssemblyCopyright("Copyright \u00A9 2015")] |
||||
|
[assembly: AssemblyTrademark("")] |
||||
|
[assembly: AssemblyCulture("")] |
||||
|
[assembly: NeutralResourcesLanguage("en")] |
||||
|
|
||||
|
// Version information for an assembly consists of the following four values:
|
||||
|
//
|
||||
|
// Major Version
|
||||
|
// Minor Version
|
||||
|
// Build Number
|
||||
|
// Revision
|
||||
|
//
|
||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
|
// by using the '*' as shown below:
|
||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
[assembly: AssemblyVersion("1.0.0.0")] |
||||
|
[assembly: AssemblyFileVersion("1.0.0.0")] |
||||
|
|||||
@ -0,0 +1,23 @@ |
|||||
|
// Copyright (c) The Avalonia Project. All rights reserved.
|
||||
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
||||
|
|
||||
|
using System; |
||||
|
using System.Reactive.Concurrency; |
||||
|
using System.Threading; |
||||
|
|
||||
|
|
||||
|
namespace ReactiveUI |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Ignore me. This class is a secret handshake between RxUI and RxUI.Xaml
|
||||
|
/// in order to register certain classes on startup that would be difficult
|
||||
|
/// to register otherwise.
|
||||
|
/// </summary>
|
||||
|
public class PlatformRegistrations : IWantsToRegisterStuff |
||||
|
{ |
||||
|
public void Register(Action<Func<object>, Type> registerFunction) |
||||
|
{ |
||||
|
RxApp.MainThreadScheduler = new SynchronizationContextScheduler(SynchronizationContext.Current); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace System.Runtime.Serialization |
||||
|
{ |
||||
|
class IgnoreDataMemberAttribute : Attribute |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
class DataMemberAttribute : Attribute |
||||
|
{ |
||||
|
} |
||||
|
class OnDeserializedAttribute : Attribute |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
class DataContractAttribute : Attribute |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
class StreamingContext { } |
||||
|
} |
||||
|
|
||||
|
namespace System.Diagnostics.Contracts |
||||
|
{ |
||||
|
static class Contract |
||||
|
{ |
||||
|
public static void Requires(bool condition) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1 @@ |
|||||
|
Subproject commit 3f725c808b1d4c8457f0d3204e0a071aa462cd75 |
||||
Loading…
Reference in new issue