File tree 3 files changed +44
-9
lines changed
3 files changed +44
-9
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ namespace winrt::TerminalApp::implementation
39
39
40
40
// UpdateSettings(settings);
41
41
}
42
+
43
+
42
44
MUX::Controls::TreeViewNode _buildTreeViewNode (const Model::Command& task)
43
45
{
44
46
MUX::Controls::TreeViewNode item{};
@@ -52,6 +54,7 @@ namespace winrt::TerminalApp::implementation
52
54
}
53
55
return item;
54
56
}
57
+
55
58
void TasksPaneContent::UpdateSettings (const CascadiaSettings& settings)
56
59
{
57
60
// _treeView().RootNodes().Clear();
@@ -71,6 +74,22 @@ namespace winrt::TerminalApp::implementation
71
74
_treeView ().ItemsSource (itemSource);
72
75
}
73
76
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
+
74
93
winrt::Windows::UI::Xaml::FrameworkElement TasksPaneContent::GetRoot ()
75
94
{
76
95
return *this ;
Original file line number Diff line number Diff line change @@ -38,8 +38,12 @@ namespace winrt::TerminalApp::implementation
38
38
til::typed_event<> FocusRequested;
39
39
40
40
private:
41
+ friend struct TasksPaneContentT <TasksPaneContent>; // for Xaml to bind events
42
+
41
43
// winrt::Windows::UI::Xaml::Controls::Grid _root{ nullptr };
42
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);
43
47
};
44
48
45
49
struct TaskViewModel : TaskViewModelT<TaskViewModel>
@@ -72,7 +76,7 @@ namespace winrt::TerminalApp::implementation
72
76
73
77
private:
74
78
winrt::Microsoft::Terminal::Settings::Model::Command _command{ nullptr };
75
- winrt::Windows::Foundation::Collections::IObservableVector<TerminalApp::TaskViewModel> _children{};
79
+ winrt::Windows::Foundation::Collections::IObservableVector<TerminalApp::TaskViewModel> _children{ nullptr };
76
80
};
77
81
}
78
82
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 x : Name =" asdf"
36
- ItemsSource =" {x:Bind Children}" >
35
+ <mux : TreeViewItem ItemsSource =" {x:Bind Children}" >
37
36
<Grid >
38
37
<Grid .RowDefinitions>
39
38
<RowDefinition Height =" *" />
59
58
Fill="{ThemeResource SystemControlBackgroundBaseMediumBrush}"/>-->
60
59
<TextBlock Grid.Column=" 1"
61
60
Margin =" 12,6,0,0"
62
- x : Phase =" 1"
63
61
Style =" {ThemeResource BaseTextBlockStyle}"
64
62
Text =" {x:Bind Name, Mode=OneWay}" />
65
63
<TextBlock Grid.Row=" 1"
66
64
Grid.Column=" 1"
67
65
Margin =" 12,0,0,6"
68
- x : Phase =" 2"
69
66
MaxLines =" 1"
70
67
Style =" {ThemeResource BodyTextBlockStyle}"
71
- Text =" {x:Bind Input}"
72
- Visibility =" {Binding ElementName=asdf, Path=IsSelected}" />
68
+ Text =" {x:Bind Input}" />
73
69
</Grid >
74
70
</mux : TreeViewItem >
75
71
</DataTemplate >
76
72
</ResourceDictionary >
77
73
</UserControl .Resources>
78
74
79
- <StackPanel Orientation =" Vertical" >
75
+ <Grid Background =" Red" >
76
+ <Grid .RowDefinitions>
77
+ <RowDefinition Height =" Auto" />
78
+ <RowDefinition Height =" Auto" />
79
+ <RowDefinition Height =" *" />
80
+ </Grid .RowDefinitions>
81
+
80
82
<TextBlock x : Name =" _title"
83
+ Grid.Row=" 0"
81
84
Margin =" 9"
82
85
FontSize =" 24"
83
86
Text =" Tasks" />
87
+
88
+ <TextBox x : Name =" _filterBox"
89
+ Grid.Row=" 1"
90
+ Margin =" 8" />
91
+
84
92
<mux : TreeView x : Name =" _treeView"
93
+ Grid.Row=" 2"
94
+ Background =" Blue"
95
+ CanDragItems =" False"
96
+ CanReorderItems =" False"
85
97
ItemTemplate =" {StaticResource TaskItemTemplate}" />
86
- </StackPanel >
98
+ </Grid >
87
99
88
100
</UserControl >
You can’t perform that action at this time.
0 commit comments