Skip to content

Commit

Permalink
[Visual|Logical]Tree extensions revamp (#3685)
Browse files Browse the repository at this point in the history
<!-- 🚨 Please Do Not skip any instructions and information mentioned below as they are all required and essential to evaluate and test the PR. By fulfilling all the required information you will be able to reduce the volume of questions and most likely help merge the PR faster 🚨 -->

<!-- 📝 It is preferred if you keep the "☑️ Allow edits by maintainers" checked in the Pull Request Template as it increases collaboration with the Toolkit maintainers by permitting commits to your PR branch (only) created from your fork.  This can let us quickly make fixes for minor typos or forgotten StyleCop issues during review without needing to wait on you doing extra work. Let us help you help us! 🎉 -->


## Closes #3487 
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR. -->

 - Feature 
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## Overview
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
There are some inconsistencies in the visual tree extensions mentioned in the linked issue, and some missing features.
This PR applies the changes mentioned in #3487 (comment).

## APIs breakdown

<details>
    <summary><b>VisualTree (click to expand):</b></summary>
<br/>

```csharp
namespace Microsoft.Toolkit.Uwp.UI.Extensions
{
    public static class VisualTree
    {
        static FrameworkElement? FindDescendant(this DependencyObject element, string name, StringComparison comparisonType = StringComparison.Ordinal);
        static T? FindDescendant<T>(this DependencyObject element) where T : notnull, DependencyObject;
        static DependencyObject? FindDescendant(this DependencyObject element, Type type);
        static T? FindDescendant<T>(this DependencyObject element, Func<T, bool> predicate) where T : notnull, DependencyObject;
        static T? FindDescendant<T, TState>(this DependencyObject element, TState state, Func<T, TState, bool> predicate) where T : notnull, DependencyObject;
        static FrameworkElement? FindDescendantOrSelf(this DependencyObject element, string name, StringComparison comparisonType = StringComparison.Ordinal);
        static T? FindDescendantOrSelf<T>(this DependencyObject element) where T : notnull, DependencyObject;
        static DependencyObject? FindDescendantOrSelf(this DependencyObject element, Type type);
        static T? FindDescendantOrSelf<T>(this DependencyObject element, Func<T, bool> predicate) where T : notnull, DependencyObject;
        static T? FindDescendantOrSelf<T, TState>(this DependencyObject element, TState state, Func<T, TState, bool> predicate) where T : notnull, DependencyObject;

        static IEnumerable<DependencyObject> FindDescendants(this DependencyObject element);

        static FrameworkElement? FindAscendant(this DependencyObject element, string name, StringComparison comparisonType = StringComparison.Ordinal);
        static T? FindAscendant<T>(this DependencyObject element) where T : notnull, DependencyObject;
        static DependencyObject? FindAscendant(this DependencyObject element, Type type);
        static T? FindAscendant<T>(this DependencyObject element, Func<T, bool> predicate) where T : notnull, DependencyObject;
        static T? FindAscendant<T, TState>(this DependencyObject element, TState state, Func<T, TState, bool> predicate) where T : notnull, DependencyObject;
        static FrameworkElement? FindAscendantOrSelf(this DependencyObject element, string name, StringComparison comparisonType = StringComparison.Ordinal);
        static T? FindAscendantOrSelf<T>(this DependencyObject element) where T : notnull, DependencyObject;
        static DependencyObject? FindAscendantOrSelf(this DependencyObject element, Type type);
        static T? FindAscendantOrSelf<T>(this DependencyObject element, Func<T, bool> predicate) where T : notnull, DependencyObject;
        static T? FindAscendantOrSelf<T, TState>(this DependencyObject element, TState state, Func<T, TState, bool> predicate) where T : notnull, DependencyObject;

        static IEnumerable<DependencyObject> FindAscendants(this DependencyObject element);
    }
}
```
</details>

<details>
    <summary><b>LogicalTree (click to expand):</b></summary>
<br/>

```csharp
namespace Microsoft.Toolkit.Uwp.UI.Extensions
{
    public static class LogicalTree
    {
        static FrameworkElement? FindChild(this FrameworkElement element, string name, StringComparison comparisonType = StringComparison.Ordinal);
        static T? FindChild<T>(this FrameworkElement element) where T : notnull, FrameworkElement;
        static FrameworkElement? FindChild(this FrameworkElement element, Type type);
        static T? FindChild<T>(this FrameworkElement element, Func<T, bool> predicate) where T : notnull, FrameworkElement;
        static T? FindChild<T, TState>(this FrameworkElement element, TState state, Func<T, TState, bool> predicate) where T : notnull, FrameworkElement;
        static FrameworkElement? FindChildOrSelf(this FrameworkElement element, string name, StringComparison comparisonType = StringComparison.Ordinal);
        static T? FindChildOrSelf<T>(this FrameworkElement element) where T : notnull, FrameworkElement;
        static FrameworkElement? FindChildOrSelf(this FrameworkElement element, Type type);
        static T? FindChildOrSelf<T>(this FrameworkElement element, Func<T, bool> predicate) where T : notnull, FrameworkElement;
        static T? FindChildOrSelf<T, TState>(this FrameworkElement element, TState state, Func<T, TState, bool> predicate) where T : notnull, FrameworkElement;

        static IEnumerable<FrameworkElement> FindChildren(this FrameworkElement element);

        static FrameworkElement? FindParent(this FrameworkElement element, string name, StringComparison comparisonType = StringComparison.Ordinal);
        static T? FindParent<T>(this FrameworkElement element) where T : notnull, FrameworkElement;
        static FrameworkElement? FindParent(this FrameworkElement element, Type type);
        static T? FindParent<T>(this FrameworkElement element, Func<T, bool> predicate) where T : notnull, FrameworkElement;
        static T? FindParent<T, TState>(this FrameworkElement element, TState state, Func<T, TState, bool> predicate) where T : notnull, FrameworkElement;
        static FrameworkElement? FindParentOrSelf(this FrameworkElement element, string name, StringComparison comparisonType = StringComparison.Ordinal);
        static T? FindParentOrSelf<T>(this FrameworkElement element) where T : notnull, FrameworkElement;
        static FrameworkElement? FindParentOrSelf(this FrameworkElement element, Type type);
        static T? FindParentOrSelf<T>(this FrameworkElement element, Func<T, bool> predicate) where T : notnull, FrameworkElement;
        static T? FindParentOrSelf<T, TState>(this FrameworkElement element, TState state, Func<T, TState, bool> predicate) where T : notnull, FrameworkElement;

        static IEnumerable<FrameworkElement> FindParents(this FrameworkElement element);
        
        static UIElement? TryGetContentControl(this FrameworkElement element);
        static object? TryFindResource(this FrameworkElement element, object resourceKey);
    }
}
```
</details>

## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->
- [ ] Sample in sample app has been added / updated (for bug fixes / features)
    - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)
- [ ] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [ ] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [X] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [ ] Contains **NO** breaking changes

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. 
     Please note that breaking changes are likely to be rejected within minor release cycles or held until major versions. -->


## Other information
Opening as draft, missing updated/revamped unit tests.
  • Loading branch information
msftbot[bot] authored Feb 22, 2021
2 parents 221d1ec + 13b972a commit c37bd7b
Show file tree
Hide file tree
Showing 63 changed files with 1,248 additions and 417 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ private void UpdateXamlRender(string text)

if (CurrentSample.HasType)
{
root = SamplePage?.FindDescendantByName("XamlRoot");
root = SamplePage?.FindDescendant("XamlRoot");

if (root is Panel)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public AdaptiveGridViewPage()

public async void OnXamlRendered(FrameworkElement control)
{
_adaptiveGridViewControl = control.FindDescendantByName("AdaptiveGridViewControl") as AdaptiveGridView;
_adaptiveGridViewControl = control.FindDescendant("AdaptiveGridViewControl") as AdaptiveGridView;
if (_adaptiveGridViewControl != null)
{
var allPhotos = await new Data.PhotosDataSource().GetItemsAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public BladePage()

public void OnXamlRendered(FrameworkElement control)
{
bladeView = control.FindChildByName("BladeView") as BladeView;
addBlade = control.FindChildByName("AddBlade") as Button;
bladeView = control.FindChild("BladeView") as BladeView;
addBlade = control.FindChild("AddBlade") as Button;

if (addBlade != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ public async void OnXamlRendered(FrameworkElement control)
_cameraPreviewControl.CameraHelper.FrameArrived += CameraPreviewControl_FrameArrived;
}

_imageControl = control.FindDescendantByName("CurrentFrameImage") as Image;
_imageControl = control.FindDescendant("CurrentFrameImage") as Image;
if (_imageControl != null)
{
_softwareBitmapSource = new SoftwareBitmapSource();
_imageControl.Source = _softwareBitmapSource;
}

_errorMessageText = control.FindDescendantByName("ErrorMessage") as TextBlock;
_errorMessageText = control.FindDescendant("ErrorMessage") as TextBlock;

semaphoreSlim.Release();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public CarouselPage()

public async void OnXamlRendered(FrameworkElement control)
{
carouselControl = control.FindDescendantByName("CarouselControl") as Carousel;
carouselControl = control.FindDescendant("CarouselControl") as Carousel;
carouselControl.ItemsSource = await new Data.PhotosDataSource().GetItemsAsync();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async void OnXamlRendered(FrameworkElement control)
dataGrid.LoadingRowGroup -= DataGrid_LoadingRowGroup;
}

dataGrid = control.FindDescendantByName("dataGrid") as DataGrid;
dataGrid = control.FindDescendant("dataGrid") as DataGrid;
if (dataGrid != null)
{
dataGrid.Sorting += DataGrid_Sorting;
Expand All @@ -54,7 +54,7 @@ public async void OnXamlRendered(FrameworkElement control)
groupButton.Click -= GroupButton_Click;
}

groupButton = control.FindDescendantByName("groupButton") as AppBarButton;
groupButton = control.FindDescendant("groupButton") as AppBarButton;
if (groupButton != null)
{
groupButton.Click += GroupButton_Click;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
Expand All @@ -29,7 +28,7 @@ public DockPanelPage()

public void OnXamlRendered(FrameworkElement control)
{
_sampleDockPanel = control.FindChildByName("SampleDockPanel") as DockPanel;
_sampleDockPanel = control.FindChild("SampleDockPanel") as DockPanel;
}

private void Load()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public FadeHeaderBehaviorPage()

public void OnXamlRendered(FrameworkElement control)
{
myListView = control.FindChildByName("MyListView") as ListView;
myListView = control.FindChild("MyListView") as ListView;

// Load the ListView with Sample Data
if (myListView != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
using Microsoft.Toolkit.Uwp.UI.Extensions;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Shapes;

namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
Expand All @@ -33,7 +31,7 @@ public void OnXamlRendered(FrameworkElement control)

WarnUserToPlugInDevice();

var buttonControl = control.FindChildByName("TargetButton") as Button;
var buttonControl = control.FindChild("TargetButton") as Button;

if (buttonControl != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public GazeTracingPage()

public void OnXamlRendered(FrameworkElement control)
{
if (control.FindChildByName("Points") is ItemsControl itemsControl)
if (control.FindChild("Points") is ItemsControl itemsControl)
{
itemsControl.ItemsSource = GazeHistory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Linq;
using Microsoft.Toolkit.Uwp.UI.Controls;
using Microsoft.Toolkit.Uwp.UI.Extensions;
using Windows.UI.Xaml;
Expand All @@ -26,7 +27,7 @@ public HeaderedItemsControlPage()

public void OnXamlRendered(FrameworkElement element)
{
foreach (var control in element.FindChildren<HeaderedItemsControl>())
foreach (var control in element.FindChildren().OfType<HeaderedItemsControl>())
{
control.DataContext = this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public ImageCachePage()

public void OnXamlRendered(FrameworkElement control)
{
photoList = control.FindChildByName("PhotoList") as ListView;
photoList = control.FindChild("PhotoList") as ListView;
}

private async void Load()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@

using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading.Tasks;
using Microsoft.Toolkit.Uwp.UI.Controls;
using Microsoft.Toolkit.Uwp.UI.Extensions;
using Windows.Graphics.Imaging;
using Windows.Storage;
using Windows.Storage.Pickers;
using Windows.UI.Xaml;
Expand All @@ -35,7 +32,7 @@ public ImageCropperPage()

public async void OnXamlRendered(FrameworkElement control)
{
_imageCropper = control.FindChildByName("ImageCropper") as ImageCropper;
_imageCropper = control.FindChild("ImageCropper") as ImageCropper;
if (_imageCropper != null)
{
var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Photos/Owl.jpg"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public ImageExPage()
public void OnXamlRendered(FrameworkElement control)
{
// Need to use logical tree here as scrollviewer hasn't initialized yet even with dispatch.
container = control.FindChildByName("Container") as StackPanel;
container = control.FindChild("Container") as StackPanel;
resources = control.Resources;
lazyLoadingControlHost = control.FindChildByName("LazyLoadingControlHost") as Border;
lazyLoadingControlHost = control.FindChild("LazyLoadingControlHost") as Border;
}

private async void Load()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public ImplicitAnimationsPage()

public void OnXamlRendered(FrameworkElement control)
{
_element = control.FindChildByName("Element");
_element = control.FindChild("Element");
}

private void Load()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ public void OnXamlRendered(FrameworkElement control)
{
NotificationDuration = 0;

_exampleInAppNotification = control.FindChildByName("ExampleInAppNotification") as InAppNotification;
_exampleInAppNotification = control.FindChild("ExampleInAppNotification") as InAppNotification;
_defaultInAppNotificationControlTemplate = _exampleInAppNotification?.Template;
_exampleCustomInAppNotification = control.FindChildByName("ExampleCustomInAppNotification") as InAppNotification;
_exampleCustomInAppNotification = control.FindChild("ExampleCustomInAppNotification") as InAppNotification;
_customInAppNotificationControlTemplate = _exampleCustomInAppNotification?.Template;
_exampleVSCodeInAppNotification = control.FindChildByName("ExampleVSCodeInAppNotification") as InAppNotification;
_exampleVSCodeInAppNotification = control.FindChild("ExampleVSCodeInAppNotification") as InAppNotification;
_resources = control.Resources;

var notificationDurationTextBox = control.FindChildByName("NotificationDurationTextBox") as TextBox;
var notificationDurationTextBox = control.FindChild("NotificationDurationTextBox") as TextBox;
if (notificationDurationTextBox != null)
{
notificationDurationTextBox.TextChanged += NotificationDurationTextBox_TextChanged;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public InfiniteCanvasPage()

public void OnXamlRendered(FrameworkElement control)
{
_infiniteCanvas = control.FindChildByName("canvas") as InfiniteCanvas;
_infiniteCanvas = control.FindChild("canvas") as InfiniteCanvas;
}

private void Load()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public ItemsReorderAnimationPage()

public async void OnXamlRendered(FrameworkElement control)
{
imageView = control.FindChildByName("ImageView") as GridView;
imageView = control.FindChild("ImageView") as GridView;

if (imageView != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public ListViewExtensionsPage()

public async void OnXamlRendered(FrameworkElement control)
{
var sampleListView = control.FindChildByName("SampleListView") as ListView;
var sampleListView = control.FindChild("SampleListView") as ListView;

if (sampleListView != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ public LoadingPage()

public async void OnXamlRendered(FrameworkElement control)
{
loadingControl = control.FindDescendantByName("LoadingControl") as Loading;
loadingContentControl = control.FindChildByName("LoadingContentControl") as ContentControl;
loadingControl = control.FindDescendant("LoadingControl") as Loading;
loadingContentControl = control.FindChild("LoadingContentControl") as ContentControl;
resources = control.Resources;

if (control.FindChildByName("AdaptiveGridViewControl") is AdaptiveGridView gridView)
if (control.FindChild("AdaptiveGridViewControl") is AdaptiveGridView gridView)
{
gridView.ItemsSource = await new Data.PhotosDataSource().GetItemsAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public MarkdownTextBlockPage()

public void OnXamlRendered(FrameworkElement control)
{
unformattedText = control.FindChildByName("UnformattedText") as TextBox;
unformattedText = control.FindChild("UnformattedText") as TextBox;

markdownText = control.FindChildByName("MarkdownText") as MarkdownTextBlock;
markdownText = control.FindChild("MarkdownText") as MarkdownTextBlock;

if (markdownText != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public MenuPage()

public void OnXamlRendered(FrameworkElement control)
{
fileMenu = control.FindChildByName("FileMenu") as MenuItem;
fileMenu = control.FindChild("FileMenu") as MenuItem;
}
#pragma warning restore CS0618 // Type or member is obsolete

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ public OrbitViewPage()

public void OnXamlRendered(FrameworkElement control)
{
var people = control.FindChildByName("People") as OrbitView;
var people = control.FindChild("People") as OrbitView;
if (people != null)
{
people.ItemClick += People_ItemClick;
}

var devices = control.FindChildByName("Devices") as OrbitView;
var devices = control.FindChild("Devices") as OrbitView;
if (devices != null)
{
devices.ItemsSource = DeviceList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;

namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
Expand Down Expand Up @@ -40,7 +39,7 @@ public PrintHelperPage()

public void OnXamlRendered(FrameworkElement control)
{
var listView = control.FindChildByName("PrintSampleListView") as ListView;
var listView = control.FindChild("PrintSampleListView") as ListView;
if (listView == null)
{
customPrintTemplate = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@ public RotatorTilePage()

public void OnXamlRendered(FrameworkElement control)
{
var tile1 = control.FindChildByName("Tile1") as RotatorTile;
var tile1 = control.FindChild("Tile1") as RotatorTile;

if (tile1 != null)
{
tile1.ItemsSource = _pictures;
}

var tile2 = control.FindChildByName("Tile2") as RotatorTile;
var tile2 = control.FindChild("Tile2") as RotatorTile;

if (tile2 != null)
{
tile2.ItemsSource = _pictures;
}

var tile3 = control.FindChildByName("Tile3") as RotatorTile;
var tile3 = control.FindChild("Tile3") as RotatorTile;

if (tile3 != null)
{
tile3.ItemsSource = _pictures;
}

var tile4 = control.FindChildByName("Tile4") as RotatorTile;
var tile4 = control.FindChild("Tile4") as RotatorTile;

if (tile4 != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public ScrollHeaderPage()

public void OnXamlRendered(FrameworkElement control)
{
var listView = control.FindChildByName("listView") as ListView;
var listView = control.FindChild("listView") as ListView;
if (listView != null)
{
listView.ItemsSource = _items;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public ScrollViewerExtensionsPage()

public void OnXamlRendered(FrameworkElement control)
{
var listView = control.FindChildByName("listView") as ListView;
var listView = control.FindChild("listView") as ListView;
if (listView != null)
{
listView.ItemsSource = _items;

var shapesPanel = control.FindChildByName("shapesPanel") as StackPanel;
var shapesPanel = control.FindChild("shapesPanel") as StackPanel;
if (shapesPanel != null)
{
var listScrollViewer = listView.FindDescendant<ScrollViewer>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public StaggeredLayoutPage()

public void OnXamlRendered(FrameworkElement control)
{
var repeater = control.FindDescendantByName("StaggeredRepeater") as ItemsRepeater;
var repeater = control.FindDescendant("StaggeredRepeater") as ItemsRepeater;

if (repeater != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public StaggeredPanelPage()

public async void OnXamlRendered(FrameworkElement control)
{
var gridView = control.FindChildByName("GridView") as ItemsControl;
var gridView = control.FindChild("GridView") as ItemsControl;

if (gridView == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public TextBoxMaskPage()

public void OnXamlRendered(FrameworkElement control)
{
alphaTextBox = control.FindChildByName("AlphaTextBox") as TextBox;
alphaTextBox = control.FindChild("AlphaTextBox") as TextBox;
}

private void Load()
Expand Down
Loading

0 comments on commit c37bd7b

Please sign in to comment.