1aff3bc216
* Created a ViewModel class in the Command Palette called FilteredCommand, aggregating the Command, the filter and the highlighted presentation of the command name * This ListView of the filtered commands is bound to the vector of FilteredCommands * Introduced HighlightedTextControl user control with HighlightedText view model * Added this control to the ListView Item's grid * Bound the FilteredCommand's highlighted command name to the user control ## Validation Steps Performed * UT for matching algorithm * Only manual tests * Searching in CommandLine, SwitchTab and Nested Command modes * Checking for bot matching an non matching filters * Dogfooding Closes #6646
34 lines
984 B
C++
34 lines
984 B
C++
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
#pragma once
|
|
|
|
#include "winrt/Microsoft.UI.Xaml.Controls.h"
|
|
|
|
#include "HighlightedTextControl.g.h"
|
|
#include "../../cascadia/inc/cppwinrt_utils.h"
|
|
|
|
namespace winrt::TerminalApp::implementation
|
|
{
|
|
struct HighlightedTextControl : HighlightedTextControlT<HighlightedTextControl>
|
|
{
|
|
HighlightedTextControl();
|
|
|
|
static Windows::UI::Xaml::DependencyProperty TextProperty();
|
|
|
|
winrt::TerminalApp::HighlightedText Text();
|
|
void Text(winrt::TerminalApp::HighlightedText const& value);
|
|
|
|
Windows::UI::Xaml::Controls::TextBlock TextView();
|
|
|
|
private:
|
|
static Windows::UI::Xaml::DependencyProperty _textProperty;
|
|
static void _onTextChanged(Windows::UI::Xaml::DependencyObject const& o, Windows::UI::Xaml::DependencyPropertyChangedEventArgs const& e);
|
|
};
|
|
}
|
|
|
|
namespace winrt::TerminalApp::factory_implementation
|
|
{
|
|
BASIC_FACTORY(HighlightedTextControl);
|
|
}
|