File tree 3 files changed +14
-27
lines changed
3 files changed +14
-27
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ namespace winrt::TerminalApp::implementation
40
40
// UpdateSettings(settings);
41
41
}
42
42
43
-
44
43
MUX::Controls::TreeViewNode _buildTreeViewNode (const Model::Command& task)
45
44
{
46
45
MUX::Controls::TreeViewNode item{};
@@ -74,22 +73,6 @@ namespace winrt::TerminalApp::implementation
74
73
_treeView ().ItemsSource (itemSource);
75
74
}
76
75
77
- void TasksPaneContent::_containerContentChanging (
78
- const Windows::UI::Xaml::Controls::ListViewBase& /* sender*/ ,
79
- const Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs& args)
80
- {
81
- const auto itemContainer = args.ItemContainer ();
82
- if (args.InRecycleQueue () && itemContainer && itemContainer.ContentTemplate ())
83
- {
84
- // _listViewItemsCache[itemContainer.ContentTemplate()].insert(itemContainer);
85
- itemContainer.DataContext (nullptr );
86
- }
87
- else
88
- {
89
- itemContainer.DataContext (args.Item ());
90
- }
91
- }
92
-
93
76
winrt::Windows::UI::Xaml::FrameworkElement TasksPaneContent::GetRoot ()
94
77
{
95
78
return *this ;
Original file line number Diff line number Diff line change @@ -39,18 +39,14 @@ namespace winrt::TerminalApp::implementation
39
39
40
40
private:
41
41
friend struct TasksPaneContentT <TasksPaneContent>; // for Xaml to bind events
42
-
43
- // winrt::Windows::UI::Xaml::Controls::Grid _root{ nullptr };
44
- // winrt::Microsoft::UI::Xaml::Controls::TreeView _treeView{ nullptr };
45
-
46
- void _containerContentChanging (const Windows::UI::Xaml::Controls::ListViewBase& sender, const Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs& args);
47
42
};
48
43
49
44
struct TaskViewModel : TaskViewModelT<TaskViewModel>
50
45
{
51
46
TaskViewModel (const winrt::Microsoft::Terminal::Settings::Model::Command& command) :
52
47
_command{ command }
53
48
{
49
+ // The Children() method must always return a non-null vector
54
50
_children = winrt::single_threaded_observable_vector<TerminalApp::TaskViewModel>();
55
51
if (_command.HasNestedCommands ())
56
52
{
Original file line number Diff line number Diff line change 32
32
</DataTemplate >
33
33
<DataTemplate x : Key =" TaskItemTemplate"
34
34
x : DataType =" local:TaskViewModel" >
35
- <mux : TreeViewItem ItemsSource =" {x:Bind Children}" >
35
+ <mux : TreeViewItem x : Name =" rootItem"
36
+ ItemsSource =" {x:Bind Children}" >
36
37
<Grid >
37
38
<Grid .RowDefinitions>
38
39
<RowDefinition Height =" *" />
56
57
VerticalAlignment="Center"
57
58
HorizontalAlignment="Center"
58
59
Fill="{ThemeResource SystemControlBackgroundBaseMediumBrush}"/>-->
60
+ <Button Grid.Row=" 0"
61
+ Grid.Column=" 0" >
62
+ <FontIcon FontFamily =" Segoe Fluent Icons, Segoe MDL2 Assets"
63
+ FontSize =" 12"
64
+ Glyph ="  " />
65
+ </Button >
59
66
<TextBlock Grid.Column=" 1"
60
67
Margin =" 12,6,0,0"
61
68
Style =" {ThemeResource BaseTextBlockStyle}"
65
72
Margin =" 12,0,0,6"
66
73
MaxLines =" 1"
67
74
Style =" {ThemeResource BodyTextBlockStyle}"
68
- Text =" {x:Bind Input}" />
75
+ Text =" {x:Bind Input}"
76
+ Visibility =" {Binding ElementName=rootItem, Path=IsSelected}" />
69
77
</Grid >
70
78
</mux : TreeViewItem >
71
79
</DataTemplate >
72
80
</ResourceDictionary >
73
81
</UserControl .Resources>
74
82
75
- <Grid Background = " Red " >
83
+ <Grid >
76
84
<Grid .RowDefinitions>
77
85
<RowDefinition Height =" Auto" />
78
86
<RowDefinition Height =" Auto" />
87
95
88
96
<TextBox x : Name =" _filterBox"
89
97
Grid.Row=" 1"
90
- Margin =" 8" />
98
+ Margin =" 8"
99
+ PlaceholderText =" Filter tasks..." />
91
100
92
101
<mux : TreeView x : Name =" _treeView"
93
102
Grid.Row=" 2"
94
- Background =" Blue"
95
103
CanDragItems =" False"
96
104
CanReorderItems =" False"
97
105
ItemTemplate =" {StaticResource TaskItemTemplate}" />
You can’t perform that action at this time.
0 commit comments