forked from microsoft/microsoft-ui-xaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTreeViewTestPage.xaml.cpp
46 lines (37 loc) · 1.43 KB
/
TreeViewTestPage.xaml.cpp
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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
#include "pch.h"
#include "TreeViewTestPage.xaml.h"
using namespace TestAppCX;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
TreeViewTestPage::TreeViewTestPage()
{
InitializeComponent();
TreeViewData^ d1 = ref new TreeViewData("111");
TreeViewData^ d2 = ref new TreeViewData("222");
TreeViewData^ d3 = ref new TreeViewData("333");
Items->Append(d1);
Items->Append(d2);
Items->Append(d3);
}
void TestAppCX::TreeViewTestPage::ReplaceAll_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
auto newItems = ref new Platform::Array<TreeViewData^>(2);
newItems[0] = ref new TreeViewData("444");
newItems[0]->Children->Append(ref new TreeViewData("123"));
newItems[1] = ref new TreeViewData("555");
Items->ReplaceAll(newItems);
}
void TestAppCX::TreeViewTestPage::Clear_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
Items->Clear();
}