Skip to content

Commit b50f3ed

Browse files
committed
Updated leftover references in the codebase
1 parent b1dfbdd commit b50f3ed

File tree

29 files changed

+48
-54
lines changed

29 files changed

+48
-54
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/BladeView/BladePage.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public BladePage()
2525

2626
public void OnXamlRendered(FrameworkElement control)
2727
{
28-
bladeView = control.FindChildByName("BladeView") as BladeView;
29-
addBlade = control.FindChildByName("AddBlade") as Button;
28+
bladeView = control.FindChild("BladeView") as BladeView;
29+
addBlade = control.FindChild("AddBlade") as Button;
3030

3131
if (addBlade != null)
3232
{

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/DockPanel/DockPanelPage.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using Windows.UI.Xaml;
1010
using Windows.UI.Xaml.Controls;
1111
using Windows.UI.Xaml.Media;
12-
using Windows.UI.Xaml.Navigation;
1312

1413
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
1514
{
@@ -29,7 +28,7 @@ public DockPanelPage()
2928

3029
public void OnXamlRendered(FrameworkElement control)
3130
{
32-
_sampleDockPanel = control.FindChildByName("SampleDockPanel") as DockPanel;
31+
_sampleDockPanel = control.FindChild("SampleDockPanel") as DockPanel;
3332
}
3433

3534
private void Load()

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/FadeHeader/FadeHeaderBehaviorPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public FadeHeaderBehaviorPage()
2626

2727
public void OnXamlRendered(FrameworkElement control)
2828
{
29-
myListView = control.FindChildByName("MyListView") as ListView;
29+
myListView = control.FindChild("MyListView") as ListView;
3030

3131
// Load the ListView with Sample Data
3232
if (myListView != null)

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/GazeInteraction/GazeInteractionPage.xaml.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using System;
65
using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
76
using Microsoft.Toolkit.Uwp.UI.Extensions;
87
using Windows.UI.Core;
98
using Windows.UI.Xaml;
109
using Windows.UI.Xaml.Controls;
11-
using Windows.UI.Xaml.Shapes;
1210

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

3432
WarnUserToPlugInDevice();
3533

36-
var buttonControl = control.FindChildByName("TargetButton") as Button;
34+
var buttonControl = control.FindChild("TargetButton") as Button;
3735

3836
if (buttonControl != null)
3937
{

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/GazeTracing/GazeTracingPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public GazeTracingPage()
4242

4343
public void OnXamlRendered(FrameworkElement control)
4444
{
45-
if (control.FindChildByName("Points") is ItemsControl itemsControl)
45+
if (control.FindChild("Points") is ItemsControl itemsControl)
4646
{
4747
itemsControl.ItemsSource = GazeHistory;
4848
}

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/HeaderedItemsControl/HeaderedItemsControlPage.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System.Collections.Generic;
6+
using System.Linq;
67
using Microsoft.Toolkit.Uwp.UI.Controls;
78
using Microsoft.Toolkit.Uwp.UI.Extensions;
89
using Windows.UI.Xaml;
@@ -26,7 +27,7 @@ public HeaderedItemsControlPage()
2627

2728
public void OnXamlRendered(FrameworkElement element)
2829
{
29-
foreach (var control in element.FindChildren<HeaderedItemsControl>())
30+
foreach (var control in element.FindChildren().OfType<HeaderedItemsControl>())
3031
{
3132
control.DataContext = this;
3233
}

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/ImageCache/ImageCachePage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public ImageCachePage()
2929

3030
public void OnXamlRendered(FrameworkElement control)
3131
{
32-
photoList = control.FindChildByName("PhotoList") as ListView;
32+
photoList = control.FindChild("PhotoList") as ListView;
3333
}
3434

3535
private async void Load()

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/ImageCropper/ImageCropperPage.xaml.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44

55
using System;
66
using System.Collections.Generic;
7-
using System.IO;
8-
using System.Runtime.InteropServices.WindowsRuntime;
97
using System.Threading.Tasks;
108
using Microsoft.Toolkit.Uwp.UI.Controls;
119
using Microsoft.Toolkit.Uwp.UI.Extensions;
12-
using Windows.Graphics.Imaging;
1310
using Windows.Storage;
1411
using Windows.Storage.Pickers;
1512
using Windows.UI.Xaml;
@@ -35,7 +32,7 @@ public ImageCropperPage()
3532

3633
public async void OnXamlRendered(FrameworkElement control)
3734
{
38-
_imageCropper = control.FindChildByName("ImageCropper") as ImageCropper;
35+
_imageCropper = control.FindChild("ImageCropper") as ImageCropper;
3936
if (_imageCropper != null)
4037
{
4138
var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Photos/Owl.jpg"));

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/ImageEx/ImageExPage.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ public ImageExPage()
3232
public void OnXamlRendered(FrameworkElement control)
3333
{
3434
// Need to use logical tree here as scrollviewer hasn't initialized yet even with dispatch.
35-
container = control.FindChildByName("Container") as StackPanel;
35+
container = control.FindChild("Container") as StackPanel;
3636
resources = control.Resources;
37-
lazyLoadingControlHost = control.FindChildByName("LazyLoadingControlHost") as Border;
37+
lazyLoadingControlHost = control.FindChild("LazyLoadingControlHost") as Border;
3838
}
3939

4040
private async void Load()

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Implicit Animations/ImplicitAnimationsPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public ImplicitAnimationsPage()
2727

2828
public void OnXamlRendered(FrameworkElement control)
2929
{
30-
_element = control.FindChildByName("Element");
30+
_element = control.FindChild("Element");
3131
}
3232

3333
private void Load()

0 commit comments

Comments
 (0)