-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from egvijayanand/working
Native WinUI 3 Blazor Hybrid Sample
- Loading branch information
Showing
66 changed files
with
2,302 additions
and
22 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 @@ | ||
global using WinUIBlazor; | ||
global using WinUIBlazor.Views; | ||
|
||
// Static | ||
global using static Microsoft.Maui.Graphics.Colors; |
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,10 @@ | ||
<Router AppAssembly="@GetType().Assembly" AdditionalAssemblies="[ typeof(Counter).Assembly ]"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | ||
</Found> | ||
<NotFound> | ||
<LayoutView Layout="@typeof(MainLayout)"> | ||
<p>Sorry, there's nothing at this address.</p> | ||
</LayoutView> | ||
</NotFound> | ||
</Router> |
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,51 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<Application | ||
x:Class="WinUIBlazor.MyApp" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:d="http://schemas.microsoft.com/dotnet/2021/maui/design" | ||
xmlns:local="clr-namespace:WinUIBlazor" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="Resources/Colors.xaml" /> | ||
<ResourceDictionary Source="Resources/Styles.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
<!-- Additional Styles --> | ||
<x:Double x:Key="ItemSpacing">10</x:Double> | ||
|
||
<Style | ||
ApplyToDerivedTypes="True" | ||
TargetType="StackBase"> | ||
<Setter Property="Spacing" Value="{StaticResource ItemSpacing}" /> | ||
</Style> | ||
|
||
<Style | ||
x:Key="MauiLabel" | ||
TargetType="Label"> | ||
<Setter Property="TextColor" Value="{AppThemeBinding Dark={StaticResource White}, Light={StaticResource Primary}}" /> | ||
</Style> | ||
|
||
<Style | ||
x:Key="Action" | ||
TargetType="Button"> | ||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Dark={StaticResource BackgroundDark}, Light={StaticResource BackgroundLight}}" /> | ||
<Setter Property="TextColor" Value="{AppThemeBinding Dark={StaticResource TextDark}, Light={StaticResource TextLight}}" /> | ||
<Setter Property="FontFamily" Value="{StaticResource AppFont}" /> | ||
<Setter Property="FontSize" Value="{StaticResource AppFontSize}" /> | ||
<Setter Property="Padding" Value="14,10" /> | ||
</Style> | ||
|
||
<Style | ||
x:Key="PrimaryAction" | ||
BasedOn="{StaticResource Action}" | ||
TargetType="Button"> | ||
<Setter Property="BackgroundColor" Value="{StaticResource Primary}" /> | ||
<Setter Property="FontAttributes" Value="Bold" /> | ||
<Setter Property="TextColor" Value="{StaticResource White}" /> | ||
</Style> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
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 @@ | ||
namespace WinUIBlazor | ||
{ | ||
public partial class MyApp : Application | ||
{ | ||
public MyApp() | ||
{ | ||
InitializeComponent(); | ||
UserAppTheme = PlatformAppTheme; | ||
} | ||
|
||
protected override Window CreateWindow(IActivationState? activationState) | ||
=> new Window(new MainPage()) { Title = "WinUIBlazor" }; | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
src/NET_9/WinUIBlazor/WinUIBlazor.MauiLib/Resources/Colors.xaml
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,67 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<?xaml-comp compile="true" ?> | ||
<ResourceDictionary | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:d="http://schemas.microsoft.com/dotnet/2021/maui/design" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:WinUIBlazor" | ||
mc:Ignorable="d"> | ||
|
||
<Color x:Key="Primary">#512BD4</Color> | ||
<Color x:Key="Secondary">#DFD8F7</Color> | ||
<Color x:Key="Tertiary">#2B0B98</Color> | ||
<Color x:Key="White">White</Color> | ||
<Color x:Key="Black">Black</Color> | ||
<Color x:Key="Gray100">#E1E1E1</Color> | ||
<Color x:Key="Gray200">#C8C8C8</Color> | ||
<Color x:Key="Gray300">#ACACAC</Color> | ||
<Color x:Key="Gray400">#919191</Color> | ||
<Color x:Key="Gray500">#6E6E6E</Color> | ||
<Color x:Key="Gray600">#404040</Color> | ||
<Color x:Key="Gray900">#212121</Color> | ||
<Color x:Key="Gray950">#141414</Color> | ||
|
||
<Color x:Key="Light">#DFD8F7</Color> | ||
<Color x:Key="Dark">#2B0B98</Color> | ||
<Color x:Key="LightGray">#E5E5E1</Color> | ||
<Color x:Key="MidGray">#969696</Color> | ||
<Color x:Key="DarkGray">#505050</Color> | ||
|
||
<SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource Primary}"/> | ||
<SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource Secondary}"/> | ||
<SolidColorBrush x:Key="TertiaryBrush" Color="{StaticResource Tertiary}"/> | ||
<SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource White}"/> | ||
<SolidColorBrush x:Key="BlackBrush" Color="{StaticResource Black}"/> | ||
<SolidColorBrush x:Key="Gray100Brush" Color="{StaticResource Gray100}"/> | ||
<SolidColorBrush x:Key="Gray200Brush" Color="{StaticResource Gray200}"/> | ||
<SolidColorBrush x:Key="Gray300Brush" Color="{StaticResource Gray300}"/> | ||
<SolidColorBrush x:Key="Gray400Brush" Color="{StaticResource Gray400}"/> | ||
<SolidColorBrush x:Key="Gray500Brush" Color="{StaticResource Gray500}"/> | ||
<SolidColorBrush x:Key="Gray600Brush" Color="{StaticResource Gray600}"/> | ||
<SolidColorBrush x:Key="Gray900Brush" Color="{StaticResource Gray900}"/> | ||
<SolidColorBrush x:Key="Gray950Brush" Color="{StaticResource Gray950}"/> | ||
|
||
<SolidColorBrush x:Key="LightBrush" Color="{StaticResource Light}" /> | ||
<SolidColorBrush x:Key="DarkBrush" Color="{StaticResource Dark}" /> | ||
<SolidColorBrush x:Key="LightGrayBrush" Color="{StaticResource LightGray}" /> | ||
<SolidColorBrush x:Key="MidGrayBrush" Color="{StaticResource MidGray}" /> | ||
<SolidColorBrush x:Key="DarkGrayBrush" Color="{StaticResource DarkGray}" /> | ||
|
||
<!-- Dark and Light App Theme --> | ||
<Color x:Key="BackgroundDark">#121212</Color> | ||
<Color x:Key="BackgroundLight">White</Color> | ||
<Color x:Key="TextDark">White</Color> | ||
<Color x:Key="TextLight">Black</Color> | ||
|
||
<Color x:Key="Yellow100Accent">#F7B548</Color> | ||
<Color x:Key="Yellow200Accent">#FFD590</Color> | ||
<Color x:Key="Yellow300Accent">#FFE5B9</Color> | ||
<Color x:Key="Cyan100Accent">#28C2D1</Color> | ||
<Color x:Key="Cyan200Accent">#7BDDEF</Color> | ||
<Color x:Key="Cyan300Accent">#C3F2F4</Color> | ||
<Color x:Key="Blue100Accent">#3E8EED</Color> | ||
<Color x:Key="Blue200Accent">#72ACF1</Color> | ||
<Color x:Key="Blue300Accent">#A7CBF6</Color> | ||
|
||
</ResourceDictionary> |
Oops, something went wrong.