File tree 4 files changed +49
-4
lines changed
4 files changed +49
-4
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,21 @@ Custom Avalonia Themes developed by [Devolutions](https://devolutions.net/)
8
8
9
9
➡️ [ DevExpress Theme] ( https://github.com/Devolutions/avalonia-themes/blob/master/src/Devolutions.AvaloniaTheme.DevExpress/README.md )
10
10
11
+ ➡️ [ Linux Theme] ( https://github.com/Devolutions/avalonia-themes/blob/master/src/Devolutions.AvaloniaTheme.Linux/README.md )
12
+
13
+ # Sample App
14
+
15
+ Contributers can use the SampleApp to test, debug and document styles for the various controls under each theme.
16
+
17
+ ## Debugging
18
+
19
+ The SampleApp attaches the Avalonia Dev Tools for inspecting controls (open with F12).
20
+
21
+ If you own a licence for the new Dev Tools in _ Avalonia Accelerate_ , you can set an environment variable in your IDE's debug configuration.
22
+ For example, in Rider:
23
+
24
+ - Open ** Run > Edit Configurations**
25
+ - Pick your configuration for the SampleApp
26
+ - In the ** Environment Variables** field add ` USE_AVALONIA_ACCELERATE_TOOLS=true `
27
+
28
+ The F12 key then opens the new Dev Tools, and F10 opens the old version
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public class App : Application
19
19
public override void Initialize ( )
20
20
{
21
21
AvaloniaXamlLoader . Load ( this ) ;
22
-
22
+
23
23
if ( ! Avalonia . Controls . Design . IsDesignMode )
24
24
{
25
25
Styles . Clear ( ) ;
Original file line number Diff line number Diff line change
1
+ using System ;
1
2
using Avalonia ;
2
3
using Avalonia . Controls ;
3
4
using Avalonia . Controls . Primitives ;
5
+ using Avalonia . Input ;
4
6
using Avalonia . Styling ;
5
7
6
8
namespace SampleApp ;
@@ -11,7 +13,20 @@ public MainWindow()
11
13
{
12
14
InitializeComponent ( ) ;
13
15
#if DEBUG
14
- this . AttachDevTools ( ) ;
16
+ bool useAccelerate = Environment . GetEnvironmentVariable ( "USE_AVALONIA_ACCELERATE_TOOLS" ) ? . ToLowerInvariant ( ) == "true" ;
17
+
18
+ if ( useAccelerate )
19
+ {
20
+ // Enable Accelerate dev tools (AvaloniaUI.DiagnosticsSupport) - requiring a licence to use
21
+ ( Application . Current as App ) ? . AttachDeveloperTools ( ) ;
22
+ // Enable original free dev tools (Avalonia.Diagnostics) as an additional option available on F10
23
+ this . AttachDevTools ( new KeyGesture ( Key . F10 ) ) ;
24
+ }
25
+ else
26
+ {
27
+ // Enable original free dev tools (Avalonia.Diagnostics)
28
+ this . AttachDevTools ( ) ;
29
+ }
15
30
#endif
16
31
}
17
32
Original file line number Diff line number Diff line change 8
8
<AvaloniaUseCompiledBindingsByDefault >true</AvaloniaUseCompiledBindingsByDefault >
9
9
</PropertyGroup >
10
10
11
+ <PropertyGroup Condition =" '$(Configuration)' == 'Debug'" >
12
+ <!-- Prevent automatic attachment of regular free dev tools to avoid duplicate mapping of F12 key -->
13
+ <AvaloniaNameGeneratorAttachDevTools >false</AvaloniaNameGeneratorAttachDevTools >
14
+ </PropertyGroup >
15
+
11
16
<ItemGroup >
12
17
<PackageReference Include =" Avalonia" Version =" 11.3.0" />
13
18
<PackageReference Include =" Avalonia.Controls.DataGrid" Version =" 11.3.0" />
14
19
<PackageReference Include =" Avalonia.Desktop" Version =" 11.3.0" />
15
20
<PackageReference Include =" Avalonia.Fonts.Inter" Version =" 11.3.0" />
16
- <!-- Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
17
- <PackageReference Condition =" '$(Configuration)' == 'Debug'" Include =" Avalonia.Diagnostics" Version =" 11.3.0" />
18
21
</ItemGroup >
19
22
23
+ <ItemGroup >
24
+ <!-- Add both, Classic and Accelerate Dev Tools -->
25
+ <PackageReference Condition =" '$(Configuration)' == 'Debug'" Include =" Avalonia.Diagnostics" Version =" 11.3.0" />
26
+ <PackageReference Include =" AvaloniaUI.DiagnosticsSupport" Version =" 2.0.3" >
27
+ <IncludeAssets Condition =" '$(Configuration)' != 'Debug'" >None</IncludeAssets >
28
+ <PrivateAssets Condition =" '$(Configuration)' != 'Debug'" >All</PrivateAssets >
29
+ </PackageReference >
30
+ </ItemGroup >
31
+
20
32
<ItemGroup >
21
33
<PackageReference Include =" Avalonia.Svg.Skia" Version =" 11.3.0" />
22
34
<PackageReference Include =" CommunityToolkit.Mvvm" Version =" 8.4.0" />
You can’t perform that action at this time.
0 commit comments