-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscenario3_dependencies.xaml.cs
57 lines (50 loc) · 1.93 KB
/
scenario3_dependencies.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using Windows.ApplicationModel;
namespace PackageSampleHostedApp
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class Scenario3 : Page
{
// A pointer back to the main page. This is needed if you want to call methods in MainPage such
// as NotifyUser()
MainPage rootPage = MainPage.Current;
public Scenario3()
{
this.InitializeComponent();
}
void GetDependencies_Click(Object sender, RoutedEventArgs e)
{
IReadOnlyList<Windows.ApplicationModel.Package> dependencies = Package.Current.Dependencies;
String output = String.Format("Count: {0}", dependencies.Count.ToString());
for (int i = 0; i < dependencies.Count; i++)
{
Package dependency = dependencies[i];
output += String.Format("\n[{0}]: {1}", i.ToString(), dependency.Id.FullName);
}
OutputTextBlock.Text = output;
}
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
}
}
}