|
2 | 2 | using System.Collections.Generic;
|
3 | 3 | using System.Windows;
|
4 | 4 | using System.Windows.Controls;
|
| 5 | +using System.Windows.Controls.Ribbon; |
5 | 6 | using System.Windows.Data;
|
6 | 7 | using System.Windows.Interop;
|
7 | 8 | using _1RM.Model;
|
@@ -103,51 +104,85 @@ protected HostBase(ProtocolBase protocolServer, bool canFullScreen = false)
|
103 | 104 | });
|
104 | 105 | }
|
105 | 106 |
|
106 |
| - { |
107 |
| - var cb = new CheckBox |
108 |
| - { |
109 |
| - Content = IoC.Translate("Show XXX button", IoC.Translate("Reconnect") ?? ""), |
110 |
| - IsHitTestVisible = false, |
111 |
| - }; |
112 |
| - |
113 |
| - var binding = new Binding("TabHeaderShowReConnectButton") |
114 |
| - { |
115 |
| - Source = SettingsPage, |
116 |
| - Mode = BindingMode.TwoWay, |
117 |
| - UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, |
118 |
| - }; |
119 |
| - cb.SetBinding(CheckBox.IsCheckedProperty, binding); |
120 |
| - MenuItems.Add(new System.Windows.Controls.MenuItem() |
121 |
| - { |
122 |
| - Header = cb, |
123 |
| - Command = new RelayCommand((_) => { SettingsPage.TabHeaderShowReConnectButton = !SettingsPage.TabHeaderShowReConnectButton; }), |
124 |
| - }); |
125 |
| - } |
| 107 | + MenuItems.Add(new Separator()); |
126 | 108 |
|
127 | 109 | {
|
128 |
| - var cb = new CheckBox |
129 |
| - { |
130 |
| - Content = IoC.Translate("Show XXX button", IoC.Translate("Close") ?? ""), |
131 |
| - IsHitTestVisible = false, |
132 |
| - }; |
133 |
| - |
134 |
| - var binding = new Binding("TabHeaderShowCloseButton") |
135 |
| - { |
136 |
| - Source = SettingsPage, |
137 |
| - Mode = BindingMode.TwoWay, |
138 |
| - UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, |
139 |
| - }; |
140 |
| - cb.SetBinding(CheckBox.IsCheckedProperty, binding); |
141 |
| - MenuItems.Add(new System.Windows.Controls.MenuItem() |
142 |
| - { |
143 |
| - Header = cb, |
144 |
| - Command = new RelayCommand((_) => { SettingsPage.TabHeaderShowCloseButton = !SettingsPage.TabHeaderShowCloseButton; }), |
145 |
| - }); |
146 |
| - } |
147 |
| - |
148 |
| - //MenuItems.Add(new RibbonApplicationSplitMenuItem()); |
149 |
| - |
150 |
| - var actions = protocolServer.GetActions(true); |
| 110 | + var subMenu = new System.Windows.Controls.MenuItem() |
| 111 | + { |
| 112 | + Header = IoC.Translate("Custom"), |
| 113 | + }; |
| 114 | + |
| 115 | + |
| 116 | + { |
| 117 | + var cb = new CheckBox |
| 118 | + { |
| 119 | + Content = IoC.Translate("Show XXX button", IoC.Translate("Reconnect") ?? ""), |
| 120 | + IsHitTestVisible = false, |
| 121 | + }; |
| 122 | + |
| 123 | + var binding = new Binding("TabHeaderShowReConnectButton") |
| 124 | + { |
| 125 | + Source = SettingsPage, |
| 126 | + Mode = BindingMode.TwoWay, |
| 127 | + UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, |
| 128 | + }; |
| 129 | + cb.SetBinding(CheckBox.IsCheckedProperty, binding); |
| 130 | + subMenu.Items.Add(new System.Windows.Controls.MenuItem() |
| 131 | + { |
| 132 | + Header = cb, |
| 133 | + Command = new RelayCommand((_) => { SettingsPage.TabHeaderShowReConnectButton = !SettingsPage.TabHeaderShowReConnectButton; }), |
| 134 | + }); |
| 135 | + } |
| 136 | + |
| 137 | + { |
| 138 | + var cb = new CheckBox |
| 139 | + { |
| 140 | + Content = IoC.Translate("Show XXX button", IoC.Translate("Close") ?? ""), |
| 141 | + IsHitTestVisible = false, |
| 142 | + }; |
| 143 | + |
| 144 | + var binding = new Binding("TabHeaderShowCloseButton") |
| 145 | + { |
| 146 | + Source = SettingsPage, |
| 147 | + Mode = BindingMode.TwoWay, |
| 148 | + UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, |
| 149 | + }; |
| 150 | + cb.SetBinding(CheckBox.IsCheckedProperty, binding); |
| 151 | + subMenu.Items.Add(new System.Windows.Controls.MenuItem() |
| 152 | + { |
| 153 | + Header = cb, |
| 154 | + Command = new RelayCommand((_) => { SettingsPage.TabHeaderShowCloseButton = !SettingsPage.TabHeaderShowCloseButton; }), |
| 155 | + }); |
| 156 | + } |
| 157 | + |
| 158 | + |
| 159 | + { |
| 160 | + var cb = new CheckBox |
| 161 | + { |
| 162 | + Content = IoC.Translate("Show XXX button", "Icon"), |
| 163 | + IsHitTestVisible = false, |
| 164 | + }; |
| 165 | + |
| 166 | + var binding = new Binding("TabHeaderShowIconButton") |
| 167 | + { |
| 168 | + Source = SettingsPage, |
| 169 | + Mode = BindingMode.TwoWay, |
| 170 | + UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, |
| 171 | + }; |
| 172 | + cb.SetBinding(CheckBox.IsCheckedProperty, binding); |
| 173 | + subMenu.Items.Add(new System.Windows.Controls.MenuItem() |
| 174 | + { |
| 175 | + Header = cb, |
| 176 | + Command = new RelayCommand((_) => { SettingsPage.TabHeaderShowIconButton = !SettingsPage.TabHeaderShowIconButton; }), |
| 177 | + }); |
| 178 | + } |
| 179 | + |
| 180 | + MenuItems.Add(subMenu); |
| 181 | + } |
| 182 | + |
| 183 | + MenuItems.Add(new Separator()); |
| 184 | + |
| 185 | + var actions = protocolServer.GetActions(true); |
151 | 186 | foreach (var action in actions)
|
152 | 187 | {
|
153 | 188 | var tb = new TextBlock()
|
@@ -184,7 +219,7 @@ public string ConnectionId
|
184 | 219 | /// <summary>
|
185 | 220 | /// special menu for tab
|
186 | 221 | /// </summary>
|
187 |
| - public List<System.Windows.Controls.MenuItem> MenuItems { get; set; } = new List<System.Windows.Controls.MenuItem>(); |
| 222 | + public List<System.Windows.Controls.Control> MenuItems { get; set; } = new List<System.Windows.Controls.Control>(); |
188 | 223 |
|
189 | 224 | /// <summary>
|
190 | 225 | /// since resizing when rdp is connecting would not tiger the rdp size change event
|
|
0 commit comments