Skip to content

Commit

Permalink
fix!: Move PersonPicture to MUX namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Feb 16, 2023
1 parent 853671a commit e5109a4
Show file tree
Hide file tree
Showing 96 changed files with 52 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
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">
Expand Down Expand Up @@ -75,19 +76,19 @@
x:Name="ContactBtn"
AutomationProperties.Name="ContactBtn"
Content="Set Contact"
Margin="0,0,10,0"
Margin="0,0,10,0"
Click="ContactBtn_Click" />
<Button
x:Name="ContactImageBtn"
AutomationProperties.Name="ContactImageBtn"
Content="Set Contact (w/ Image)"
Margin="10,0,10,0"
Margin="10,0,10,0"
Click="ContactImageBtn_Click" />
<Button
x:Name="ClearContactBtn"
AutomationProperties.Name="ClearContactBtn"
Content="Clear Contact"
Margin="10,0,10,0"
Margin="10,0,10,0"
Click="ClearContactBtn_Click" />
</StackPanel>

Expand All @@ -97,13 +98,13 @@
x:Name="ImageBtn"
AutomationProperties.Name="ImageBtn"
Content="Set Image"
Margin="0,0,10,0"
Margin="0,0,10,0"
Click="ImageBtn_Click" />
<Button
x:Name="ClearImageBtn"
AutomationProperties.Name="ClearImageBtn"
Content="Clear Image"
Margin="10,0,10,0"
Margin="10,0,10,0"
Click="ClearImageBtn_Click" />
</StackPanel>

Expand Down Expand Up @@ -141,43 +142,43 @@
<StackPanel Grid.Column="1">
<TextBlock Text="Sample controls" Style="{ThemeResource StandardGroupHeader}"/>

<PersonPicture
<controls:PersonPicture
x:Name="TestPersonPicture"
AutomationProperties.Name="TestPersonPicture"
AutomationProperties.Name="TestPersonPicture"
SizeChanged="TestPersonPicture_SizeChanged"/>

<StackPanel Orientation="Horizontal">
<ListView x:Name="PeopleLV" AutomationProperties.Name="PeopleLV" Height="200" Margin="10">
<ListViewItem>
<PersonPicture x:Name="PersonPicture0" AutomationProperties.Name="PersonPicture0"
<controls:PersonPicture x:Name="PersonPicture0" AutomationProperties.Name="PersonPicture0"
BadgeNumber="1" BadgeGlyph="\uE765" Initials="JB" DisplayName="James Bond"/>
</ListViewItem>
<ListViewItem>
<PersonPicture x:Name="PersonPicture1" AutomationProperties.Name="PersonPicture1"
<controls:PersonPicture x:Name="PersonPicture1" AutomationProperties.Name="PersonPicture1"
BadgeNumber="2" BadgeGlyph="\uE766" Initials="AP" DisplayName="Austin Powers"/>
</ListViewItem>
<ListViewItem>
<PersonPicture x:Name="PersonPicture2" AutomationProperties.Name="PersonPicture2"
<controls:PersonPicture x:Name="PersonPicture2" AutomationProperties.Name="PersonPicture2"
BadgeNumber="3" BadgeGlyph="\uE767" Initials="SA" DisplayName="Steve Austin"/>
</ListViewItem>
<ListViewItem>
<PersonPicture x:Name="PersonPicture3" AutomationProperties.Name="PersonPicture3"
<controls:PersonPicture x:Name="PersonPicture3" AutomationProperties.Name="PersonPicture3"
BadgeNumber="4" BadgeGlyph="\uE768" Initials="SJ" DisplayName="Super Jaimie"/>
</ListViewItem>
<ListViewItem>
<PersonPicture x:Name="PersonPicture4" AutomationProperties.Name="PersonPicture4"
<controls:PersonPicture x:Name="PersonPicture4" AutomationProperties.Name="PersonPicture4"
BadgeNumber="5" BadgeGlyph="\uE769" Initials="BB" DisplayName="Bruce Banner"/>
</ListViewItem>
<ListViewItem>
<PersonPicture x:Name="PersonPicture5" AutomationProperties.Name="PersonPicture5"
<controls:PersonPicture x:Name="PersonPicture5" AutomationProperties.Name="PersonPicture5"
BadgeNumber="6" BadgeGlyph="\uE770" Initials="BW" DisplayName="Bruce Wayne"/>
</ListViewItem>
</ListView>

<ListView x:Name="PeopleGLV" AutomationProperties.Name="PeopleGLV" Height="250" Margin="10" ItemsSource="{Binding Source={StaticResource cvs}}">
<ListView.ItemTemplate>
<DataTemplate>
<PersonPicture BadgeNumber="{Binding BadgeNumber}" Initials="{Binding Initials}" DisplayName="{Binding DisplayName}"/>
<controls:PersonPicture BadgeNumber="{Binding BadgeNumber}" Initials="{Binding Initials}" DisplayName="{Binding DisplayName}"/>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.GroupStyle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting.Logging;
#endif

using PersonPicture = Windows.UI.Xaml.Controls.PersonPicture;
using PersonPicture = Microsoft.UI.Xaml.Controls.PersonPicture;

namespace Windows.UI.Xaml.Tests.MUXControls.ApiTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
using Windows.ApplicationModel.Resources;
using Windows.Foundation;
using Windows.Storage.Streams;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
using Windows.UI.Xaml.Shapes;
using Microsoft.UI.Xaml.Automation;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
using Microsoft.UI.Xaml.Shapes;

namespace Windows.UI.Xaml.Controls
namespace Microsoft.UI.Xaml.Controls
{
/// <summary>
/// Value indicating the general character set for a given character.
Expand Down Expand Up @@ -134,7 +134,7 @@ public static string InitialsFromDisplayName(string contactDisplayName)
else if (words.Length > 1)
{
// If there's at least two words, we'll show two initials.
//
//
// NOTE: Based on current implementation, we could be showing punctuation.
// For example, "John -Smith" would be "J-".
string firstWord = words.First();
Expand Down Expand Up @@ -294,7 +294,7 @@ static CharacterType GetCharacterType(string str)
}
break;
default:
// Preserve result's current state (if we never got data other
// Preserve result's current state (if we never got data other
// than "Other", it'll be set to other anyway).
break;
}
Expand Down Expand Up @@ -436,7 +436,7 @@ static CharacterType GetCharacterType(char character)
return CharacterType.Symbolic;
}

// CJK Unified Ideographs Extension
// CJK Unified Ideographs Extension
if ((character >= 0x3400) && (character <= 0x4DBF))
{
return CharacterType.Symbolic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#pragma warning disable 108 // new keyword hiding
#pragma warning disable 114 // new keyword hiding
using Windows.System.UserProfile;
using Windows.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media;
using Windows.ApplicationModel.Contacts;
using System;

namespace Windows.UI.Xaml.Controls
namespace Microsoft.UI.Xaml.Controls
{
public partial class PersonPicture : Control
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
using Windows.ApplicationModel.Resources;
using Windows.Foundation;
using Windows.Storage.Streams;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
using Windows.UI.Xaml.Shapes;
using Microsoft.UI.Xaml.Automation;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
using Microsoft.UI.Xaml.Shapes;

namespace Windows.UI.Xaml.Controls
namespace Microsoft.UI.Xaml.Controls
{
public partial class PersonPicture : Controls.Control
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Windows.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media;

namespace Windows.UI.Xaml.Controls
namespace Microsoft.UI.Xaml.Controls
{
public partial class PersonPictureTemplateSettings : DependencyObject
{
Expand Down
16 changes: 16 additions & 0 deletions src/Uno.UI/UI/Xaml/Controls/Unsupported/PersonPicture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;

namespace Windows.UI.Xaml.Controls;

[Obsolete(
"The Windows.UI.Xaml.Controls version of this control is not supported. " +
"Please use Microsoft.UI.Xaml.Controls.PersonPicture instead.")]
public partial class PersonPicture
{
public PersonPicture()
{
throw new NotImplementedException(
"The Windows.UI.Xaml.Controls version of this control is not supported. " +
"Please use Microsoft.UI.Xaml.Controls.PersonPicture instead.");
}
}
11 changes: 1 addition & 10 deletions src/Uno.WinUIRevert/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,15 @@ static void Main(string[] args)
}

// Files/Class that are implemented in both MUX and WUX and which should not be converted
Directory.Delete(Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Unsupported"), recursive: true);
var duplicatedImplementations = new[]
{
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Icon\BitmapIconSource.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Icon\SymbolIconSource.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Icon\PathIconSource.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Icon\FontIconSource.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Icon\IconSource.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Unsupported\RatingControl.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Automation\Peers\RatingControlAutomationPeer.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Unsupported\SplitButton.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Unsupported\SplitButtonAutomationPeer.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Unsupported\ToggleSplitButton.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Unsupported\ToggleSplitButtonAutomationPeer.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Unsupported\TreeView.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Unsupported\TwoPaneView.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Unsupported\ColorPicker.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Unsupported\RefreshContainer.cs"),
Path.Combine(basePath, @"src\Uno.UI\UI\Xaml\Controls\Unsupported\RefreshVisualizer.cs"),
};
DeleteFiles(duplicatedImplementations);

Expand Down

0 comments on commit e5109a4

Please sign in to comment.