-
Notifications
You must be signed in to change notification settings - Fork 8.5k
/
Copy pathAddProfile.h
63 lines (47 loc) · 1.71 KB
/
AddProfile.h
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
58
59
60
61
62
63
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- AddProfile.h
Abstract:
- This creates the 'add new profile' page in the settings UI and handles
user interaction with it, raising events to the main page as necessary
Author(s):
- Pankaj Bhojwani - March 2021
--*/
#pragma once
#include "AddProfile.g.h"
#include "AddProfilePageNavigationState.g.h"
#include "Utils.h"
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
struct AddProfilePageNavigationState : AddProfilePageNavigationStateT<AddProfilePageNavigationState>
{
public:
AddProfilePageNavigationState(const Model::CascadiaSettings& settings) :
_Settings{ settings } {}
void RequestAddNew()
{
_AddNewHandlers(winrt::guid{});
}
void RequestDuplicate(GUID profile)
{
_AddNewHandlers(profile);
}
WINRT_PROPERTY(Model::CascadiaSettings, Settings, nullptr)
WINRT_CALLBACK(AddNew, AddNewArgs);
};
struct AddProfile : public HasScrollViewer<AddProfile>, AddProfileT<AddProfile>
{
public:
AddProfile();
void OnNavigatedTo(const winrt::Windows::UI::Xaml::Navigation::NavigationEventArgs& e);
void AddNewClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs);
void DuplicateClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs);
WINRT_PROPERTY(Editor::AddProfilePageNavigationState, State, nullptr);
};
}
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
{
BASIC_FACTORY(AddProfile);
}