Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Rename UnoMauiHost to MauiHost #1697

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
</Grid.RowDefinitions>
<utu:NavigationBar Content="{Binding Title}" />

<embed:UnoMauiHost x:Name="mauiContent" Grid.Row="1">
<embed:MauiHost x:Name="mauiContent" Grid.Row="1">
<maui:Grid x:Name="grid">
<!--<map:MapView x:Name="mapView" />-->
</maui:Grid>
</embed:UnoMauiHost>
</embed:MauiHost>
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
</Grid.RowDefinitions>
<utu:NavigationBar Content="{Binding Title}" />

<embed:UnoMauiHost Grid.Row="1" x:Name="mauiContent">
<embed:MauiHost Grid.Row="1" x:Name="mauiContent">
<maui:VerticalStackLayout>
<external:CustomEntry Placeholder="This is a external control" BorderColor="{embed:MauiColor Value='Fuchsia'}"/>
</maui:VerticalStackLayout>
</embed:UnoMauiHost>
</embed:MauiHost>
</Grid>

</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
VerticalAlignment="Center">
<TextBlock FontSize="24"
Text="MCT controls" />
<embed:UnoMauiHost>
<embed:MauiHost>
<maui:ScrollView>
<maui:ScrollView.Content>
<maui:VerticalStackLayout Spacing="16" x:Name="layout">
Expand All @@ -50,7 +50,7 @@
</maui:VerticalStackLayout>
</maui:ScrollView.Content>
</maui:ScrollView>
</embed:UnoMauiHost>
</embed:MauiHost>
</StackPanel>
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
<utu:NavigationBar Content="{Binding Title}" />

<StackPanel Grid.Row="1">
<embed:UnoMauiHost>
<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:UnoMauiHost>
</embed:MauiHost>
</StackPanel>
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</Grid.RowDefinitions>
<utu:NavigationBar Content="{Binding Title}" />

<embed:UnoMauiHost x:Name="mauiContent" Grid.Row="1">
<embed:MauiHost x:Name="mauiContent" Grid.Row="1">
<maui:VerticalStackLayout x:Name="stack" Spacing="16">

<maui:Label Text="Hello World">
Expand Down Expand Up @@ -59,7 +59,7 @@
</maui:Grid>

</maui:VerticalStackLayout>
</embed:UnoMauiHost>
</embed:MauiHost>

<StackPanel
Grid.Row="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


<StackPanel Padding="10">
<embed:UnoMauiHost>
<embed:MauiHost>
<maui:ScrollView>
<maui:ScrollView.Content>
<maui:VerticalStackLayout Spacing="16">
Expand All @@ -23,6 +23,6 @@
</maui:VerticalStackLayout>
</maui:ScrollView.Content>
</maui:ScrollView>
</embed:UnoMauiHost>
</embed:MauiHost>
</StackPanel>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
/// ContentControl implementation that hosts a Maui view.
/// </summary>
[ContentProperty(Name = nameof(MauiContent))]
public partial class UnoMauiHost : ContentControl
public partial class MauiHost : ContentControl
{
/// <summary>
/// The MauiContent property represents the <see cref="MauiContent"/> that will be used as content.
/// </summary>
public static readonly DependencyProperty MauiContentProperty =
DependencyProperty.Register(nameof(MauiContent), typeof(View), typeof(UnoMauiHost), new PropertyMetadata(null, OnMauiContentChanged));
DependencyProperty.Register(nameof(MauiContent), typeof(View), typeof(MauiHost), new PropertyMetadata(null, OnMauiContentChanged));

private static void OnMauiContentChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
{
if (args.NewValue is null ||
args.NewValue is not View view ||
dependencyObject is not UnoMauiHost mauiHost)
dependencyObject is not MauiHost mauiHost)
{
return;
}
Expand All @@ -25,7 +25,7 @@ args.NewValue is not View view ||
}

private static ILogger GetLogger() =>
MauiEmbedding.MauiContext.Services.GetRequiredService<ILogger<UnoMauiHost>>();
MauiEmbedding.MauiContext.Services.GetRequiredService<ILogger<MauiHost>>();

private MauiContentHost? _host;

Expand All @@ -34,7 +34,7 @@ private static ILogger GetLogger() =>
/// <summary>
/// Initializes a new instance of the MauiContent class.
/// </summary>
public UnoMauiHost()
public MauiHost()
{
this.HorizontalContentAlignment = HorizontalAlignment.Stretch;
this.VerticalContentAlignment = VerticalAlignment.Stretch;
Expand Down