Skip to content

Commit fddc70c

Browse files
committed
Fixed some rebase issues
1 parent e7f0986 commit fddc70c

File tree

11 files changed

+8
-113
lines changed

11 files changed

+8
-113
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPicker.xaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
44
xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
5-
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
6-
xmlns:localconverters="using:Microsoft.Toolkit.Uwp.UI.Controls.ColorPickerConverters">
5+
xmlns:localconverters="using:Microsoft.Toolkit.Uwp.UI.Controls.ColorPickerConverters"
6+
xmlns:primitives="using:Microsoft.Toolkit.Uwp.UI.Controls.Primitives"
7+
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI">
78

89
<SolidColorBrush x:Key="CheckerboardColor0">
910
<SolidColorBrush.Color>

Microsoft.Toolkit.Uwp.UI/Extensions/FrameworkElement/FrameworkElementExtensions.LogicalTree.cs

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -715,110 +715,5 @@ public static bool TryFindResource(this FrameworkElement element, object resourc
715715
{
716716
return (value = TryFindResource(element, resourceKey)) is not null;
717717
}
718-
719-
/// <summary>
720-
/// Find the first parent of type <see cref="FrameworkElement"/> with a given name.
721-
/// </summary>
722-
/// <param name="element">The starting element.</param>
723-
/// <param name="name">The name of the element to look for.</param>
724-
/// <param name="comparisonType">The comparison type to use to match <paramref name="name"/>.</param>
725-
/// <returns>The parent that was found, or <see langword="null"/>.</returns>
726-
public static FrameworkElement? FindParent(this FrameworkElement element, string name, StringComparison comparisonType = StringComparison.Ordinal)
727-
{
728-
return FindParent<FrameworkElement, (string Name, StringComparison ComparisonType)>(
729-
element,
730-
(name, comparisonType),
731-
static (e, s) => s.Name.Equals(e.Name, s.ComparisonType));
732-
}
733-
734-
/// <summary>
735-
/// Find the first parent element of a given type.
736-
/// </summary>
737-
/// <typeparam name="T">The type of elements to match.</typeparam>
738-
/// <param name="element">The starting element.</param>
739-
/// <returns>The parent that was found, or <see langword="null"/>.</returns>
740-
public static T? FindParent<T>(this FrameworkElement element)
741-
where T : notnull, FrameworkElement
742-
{
743-
while (true)
744-
{
745-
if (element.Parent is not FrameworkElement parent)
746-
{
747-
return null;
748-
}
749-
750-
if (parent is T result)
751-
{
752-
return result;
753-
}
754-
755-
element = parent;
756-
}
757-
}
758-
759-
/// <summary>
760-
/// Find the first parent element of a given type.
761-
/// </summary>
762-
/// <param name="element">The starting element.</param>
763-
/// <param name="type">The type of element to match.</param>
764-
/// <returns>The parent that was found, or <see langword="null"/>.</returns>
765-
public static FrameworkElement? FindParent(this FrameworkElement element, Type type)
766-
{
767-
return FindParent<FrameworkElement, Type>(element, type, static (e, t) => e.GetType() == t);
768-
}
769-
770-
/// <summary>
771-
/// Find the first parent element matching a given predicate.
772-
/// </summary>
773-
/// <typeparam name="T">The type of elements to match.</typeparam>
774-
/// <param name="element">The starting element.</param>
775-
/// <param name="predicate">The predicatee to use to match the parent nodes.</param>
776-
/// <returns>The parent that was found, or <see langword="null"/>.</returns>
777-
public static T? FindParent<T>(this FrameworkElement element, Func<T, bool> predicate)
778-
where T : notnull, FrameworkElement
779-
{
780-
while (true)
781-
{
782-
if (element.Parent is not FrameworkElement parent)
783-
{
784-
return null;
785-
}
786-
787-
if (parent is T result && predicate(result))
788-
{
789-
return result;
790-
}
791-
792-
element = parent;
793-
}
794-
}
795-
796-
/// <summary>
797-
/// Find the first parent element matching a given predicate.
798-
/// </summary>
799-
/// <typeparam name="T">The type of elements to match.</typeparam>
800-
/// <typeparam name="TState">The type of state to use when matching nodes.</typeparam>
801-
/// <param name="element">The starting element.</param>
802-
/// <param name="state">The state to give as input to <paramref name="predicate"/>.</param>
803-
/// <param name="predicate">The predicatee to use to match the parent nodes.</param>
804-
/// <returns>The parent that was found, or <see langword="null"/>.</returns>
805-
public static T? FindParent<T, TState>(this FrameworkElement element, TState state, Func<T, TState, bool> predicate)
806-
where T : notnull, FrameworkElement
807-
{
808-
while (true)
809-
{
810-
if (element.Parent is not FrameworkElement parent)
811-
{
812-
return null;
813-
}
814-
815-
if (parent is T result && predicate(result, state))
816-
{
817-
return result;
818-
}
819-
820-
element = parent;
821-
}
822-
}
823718
}
824719
}

UnitTests/UnitTests.UWP/Extensions/Test_LogicalTreeExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
using System.Linq;
66
using System.Threading.Tasks;
7-
using Microsoft.Toolkit.Uwp.Extensions;
7+
using Microsoft.Toolkit.Uwp;
8+
using Microsoft.Toolkit.Uwp.UI;
89
using Microsoft.Toolkit.Uwp.UI.Controls;
9-
using Microsoft.Toolkit.Uwp.UI.Extensions;
1010
using Microsoft.VisualStudio.TestTools.UnitTesting;
1111
using Windows.UI.Xaml;
1212
using Windows.UI.Xaml.Controls;

UnitTests/UnitTests.UWP/Extensions/Test_VisualTreeExtensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44

55
using System.Linq;
66
using System.Threading.Tasks;
7-
using Microsoft.Toolkit.Uwp.Extensions;
7+
using Microsoft.Toolkit.Uwp;
8+
using Microsoft.Toolkit.Uwp.UI;
89
using Microsoft.Toolkit.Uwp.UI.Controls;
9-
using Microsoft.Toolkit.Uwp.UI.Extensions;
1010
using Microsoft.VisualStudio.TestTools.UnitTesting;
11-
using UnitTests.UWP.UI.Controls;
1211
using Windows.UI.Xaml;
1312
using Windows.UI.Xaml.Controls;
1413
using Windows.UI.Xaml.Markup;

0 commit comments

Comments
 (0)