-
Notifications
You must be signed in to change notification settings - Fork 742
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 #18587 from ajpinedam/ajpm/fix.ios.person.picture
fix(ios): PersonPicture late binding
- Loading branch information
Showing
5 changed files
with
114 additions
and
9 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
27 changes: 27 additions & 0 deletions
27
...ests.Shared/Windows_UI_Xaml_Controls/PersonPictureTests/PersonPictureLateBindingPage.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,27 @@ | ||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. --> | ||
<UserControl | ||
x:Class="MUXControlsTestApp.PersonPictureLateBindingPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:MUXControlsTestApp" | ||
xmlns:controls="using:Microsoft.UI.Xaml.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<StackPanel HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
x:Name="m_MainStackPanel" | ||
Spacing="16"> | ||
|
||
<PersonPicture ProfilePicture="{Binding ImagePath}" | ||
Height="100" | ||
Width="100" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" /> | ||
|
||
<TextBlock Text="{Binding LeName}" | ||
FontSize="22" | ||
HorizontalAlignment="Center"/> | ||
</StackPanel> | ||
</UserControl> |
40 changes: 40 additions & 0 deletions
40
...s.Shared/Windows_UI_Xaml_Controls/PersonPictureTests/PersonPictureLateBindingPage.xaml.cs
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,40 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.ObjectModel; | ||
using MUXControlsTestApp.Utilities; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.ApplicationModel.Contacts; | ||
using System.Threading.Tasks; | ||
|
||
namespace MUXControlsTestApp | ||
{ | ||
[SampleControlInfo( | ||
"MUX", | ||
"PersonPictureLateBinding", | ||
description: "Shows a PersonPicture control and a Textblock with a name. \n" + | ||
"The PersonPicture control image is set after 1 second delay. \n" + | ||
"The image should be displayed after the delay.", | ||
isManualTest: true)] | ||
#pragma warning disable UXAML0002 // does not explicitly define the Microsoft.UI.Xaml.Controls.UserControl base type in code behind. | ||
public sealed partial class PersonPictureLateBindingPage | ||
#pragma warning restore UXAML0002 // does not explicitly define the Microsoft.UI.Xaml.Controls.UserControl base type in code behind. | ||
{ | ||
public string ImagePath { get; } = "ms-appx:///Assets/ingredient2.png"; | ||
|
||
public string LeName { get; } = "James Bondi"; | ||
|
||
public PersonPictureLateBindingPage() | ||
{ | ||
this.InitializeComponent(); | ||
_ = SetImagePathWithDelay(); | ||
} | ||
|
||
private async Task SetImagePathWithDelay() | ||
{ | ||
await Task.Delay(1000); | ||
DataContext = this; | ||
} | ||
} | ||
} |
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