-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add auto-including Material.DataGrid styles if present
- Loading branch information
Showing
5 changed files
with
30 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<RuntimeHostConfigurationOption Include="MaterialThemeIncludeDataGrid" Value="true" /> | ||
</PropertyGroup> | ||
</Project> |
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
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 |
---|---|---|
@@ -1,16 +1,26 @@ | ||
using System; | ||
using Avalonia; | ||
using Avalonia.Animation; | ||
using Avalonia.Markup.Xaml; | ||
using Avalonia.Markup.Xaml.Styling; | ||
using Material.Styles.Additional; | ||
|
||
namespace Material.Styles { | ||
public class MaterialToolKit : Avalonia.Styling.Styles { | ||
static MaterialToolKit() { | ||
namespace Material.Styles | ||
{ | ||
public class MaterialToolKit : Avalonia.Styling.Styles | ||
{ | ||
static MaterialToolKit() | ||
{ | ||
Animation.RegisterCustomAnimator<RelativePoint, RelativePointAnimator>(); | ||
} | ||
|
||
public MaterialToolKit() { | ||
public MaterialToolKit() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
if (AppContext.TryGetSwitch("MaterialThemeIncludeDataGrid", out var includeDataGrid) && includeDataGrid) | ||
{ | ||
Add(new StyleInclude((Uri?)null) { Source = new Uri("avares://Material.DataGrid/DataGrid.xaml") }); | ||
} | ||
} | ||
} | ||
} | ||
} |