-
Notifications
You must be signed in to change notification settings - Fork 49
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 #1699 from pictos/pj/use-maui-converters
Prefer to use Maui's converter.
- Loading branch information
Showing
2 changed files
with
49 additions
and
54 deletions.
There are no files selected for viewing
83 changes: 46 additions & 37 deletions
83
samples/MauiEmbedding/MauiEmbedding/Presentation/MauiColorsPage.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 |
---|---|---|
@@ -1,43 +1,52 @@ | ||
<Page | ||
x:Class="MauiEmbedding.Presentation.MauiColorsPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:embed="using:Uno.Extensions.Maui" | ||
xmlns:maui="using:Microsoft.Maui.Controls" | ||
xmlns:local="using:MauiEmbedding.Presentation" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
Padding="20" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
mc:Ignorable="d"> | ||
x:Class="MauiEmbedding.Presentation.MauiColorsPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:embed="using:Uno.Extensions.Maui" | ||
xmlns:local="using:MauiEmbedding.Presentation" | ||
xmlns:maui="using:Microsoft.Maui.Controls" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
Padding="20" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
mc:Ignorable="d"> | ||
|
||
<Page.Resources> | ||
<ResourceDictionary> | ||
<x:String x:Key="HelloWorld">Hello from WinUI Resources</x:String> | ||
<Color x:Key="DemoColor">#169420</Color> | ||
<local:TitleConverter x:Key="TitleConverter" /> | ||
</ResourceDictionary> | ||
</Page.Resources> | ||
<Page.Resources> | ||
<ResourceDictionary> | ||
<x:String x:Key="HelloWorld">Hello from WinUI Resources</x:String> | ||
<Color x:Key="DemoColor">#169420</Color> | ||
<local:TitleConverter x:Key="TitleConverter" /> | ||
</ResourceDictionary> | ||
</Page.Resources> | ||
|
||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
<utu:NavigationBar Content="{Binding Title}" /> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
<utu:NavigationBar Content="{Binding Title}" /> | ||
|
||
<StackPanel Grid.Row="1"> | ||
<embed:MauiHost> | ||
<maui:VerticalStackLayout Spacing="10"> | ||
<maui:Label Text="This text should be Red" TextColor="{embed:MauiColor Value='#FF0000'}" /> | ||
<maui:Label x:Name="lbl" Text="This text should be Fuchsia (set on code-behind)" /> | ||
<maui:Label BackgroundColor="{embed:MauiColor Value='#FFC0CB'}" Text="This background should be Pink" /> | ||
<maui:Label Text="This TextColor should be Purple, using named color" TextColor="{embed:MauiColor Value='Purple'}" /> | ||
<maui:Label Text="{embed:MauiResource Key=HelloWorld}" TextColor="{embed:MauiResource Key=DemoColor}"/> | ||
</maui:VerticalStackLayout> | ||
</embed:MauiHost> | ||
</StackPanel> | ||
</Grid> | ||
<StackPanel Grid.Row="1"> | ||
<embed:MauiHost> | ||
<maui:VerticalStackLayout Spacing="10"> | ||
<maui:Label | ||
Margin="{embed:MauiThickness Value='0'}" | ||
Text="This text should be Red" | ||
TextColor="{embed:MauiColor Value='#FF0000'}" /> | ||
<maui:Label | ||
x:Name="lbl" | ||
Margin="{embed:MauiThickness Value='0,10'}" | ||
Text="This text should be Fuchsia (set on code-behind)" /> | ||
<maui:Label | ||
Margin="{embed:MauiThickness Value='0,10,0,10'}" | ||
BackgroundColor="{embed:MauiColor Value='#FFC0CB'}" | ||
Text="This background should be Pink" /> | ||
<maui:Label Text="This TextColor should be Purple, using named color" TextColor="{embed:MauiColor Value='Purple'}" /> | ||
<maui:Label Text="{embed:MauiResource Key=HelloWorld}" TextColor="{embed:MauiResource Key=DemoColor}" /> | ||
</maui:VerticalStackLayout> | ||
</embed:MauiHost> | ||
</StackPanel> | ||
</Grid> | ||
</Page> |
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