@@ -199,26 +199,47 @@ public async Task<FrameworkElement> InitializeAsync(CancellationToken cancellati
199
199
return null ;
200
200
}
201
201
202
- var grid = new Grid ( ) ;
202
+ var outerGrid = new Grid ( ) ;
203
203
204
- grid . ColumnDefinitions . Add ( new ColumnDefinition { Width = GridLength . Auto } ) ;
205
- grid . ColumnDefinitions . Add ( new ColumnDefinition { Width = GridLength . Auto } ) ;
204
+ ImageThemingUtilities . SetImageBackgroundColor ( outerGrid , ( Color ) Application . Current . Resources [ CommonDocumentColors . PageBackgroundColorKey ] ) ;
205
+ ThemedDialogStyleLoader . SetUseDefaultThemedDialogStyles ( outerGrid , true ) ;
206
206
207
- var inputTextBox = copilotUIProvider . GetTextBox ( ) ;
207
+ // [ prompt border | empty ]
208
+ outerGrid . ColumnDefinitions . Add ( new ColumnDefinition { Width = GridLength . Auto } ) ;
209
+ outerGrid . ColumnDefinitions . Add ( new ColumnDefinition { Width = GridLength . Auto } ) ;
208
210
209
- Grid . SetColumn ( inputTextBox . Control , 0 ) ;
210
- grid . Children . Add ( inputTextBox . Control ) ;
211
+ var promptGrid = new Grid ( ) ;
212
+
213
+ // [ input | panel ]
214
+ promptGrid . ColumnDefinitions . Add ( new ColumnDefinition { MaxWidth = 600 , Width = GridLength . Auto } ) ;
215
+ promptGrid . ColumnDefinitions . Add ( new ColumnDefinition { Width = GridLength . Auto } ) ;
216
+
217
+ var promptTextBox = copilotUIProvider . GetTextBox ( ) ;
211
218
212
219
var panel = new StackPanel ( )
213
220
{
214
221
Orientation = Orientation . Horizontal ,
215
- HorizontalAlignment = HorizontalAlignment . Right ,
222
+ HorizontalAlignment = HorizontalAlignment . Left ,
216
223
VerticalAlignment = VerticalAlignment . Bottom ,
217
224
Margin = new Thickness ( 8 , 8 , 0 , 8 ) ,
218
225
} ;
219
226
227
+ Grid . SetColumn ( promptTextBox . Control , 0 ) ;
228
+ promptGrid . Children . Add ( promptTextBox . Control ) ;
229
+
220
230
Grid . SetColumn ( panel , 1 ) ;
221
- grid . Children . Add ( panel ) ;
231
+ promptGrid . Children . Add ( panel ) ;
232
+
233
+ var promptGridBorder = new Border
234
+ {
235
+ Name = "PromptBorder" ,
236
+ BorderBrush = ( Brush ) Application . Current . Resources [ EnvironmentColors . SystemHighlightBrushKey ] ,
237
+ BorderThickness = new Thickness ( 1 ) ,
238
+ Child = promptGrid
239
+ } ;
240
+
241
+ Grid . SetColumn ( promptGridBorder , 0 ) ;
242
+ outerGrid . Children . Add ( promptGridBorder ) ;
222
243
223
244
// ComboBox for model selection
224
245
var modelPicker = new ComboBox
@@ -253,12 +274,12 @@ public async Task<FrameworkElement> InitializeAsync(CancellationToken cancellati
253
274
254
275
panel . Children . Add ( submitButton ) ;
255
276
256
- submitButton . Click += ( _ , _ ) => SubmitCopilotQuery ( inputTextBox . Text , modelPicker . Text ) ;
277
+ submitButton . Click += ( _ , _ ) => SubmitCopilotQuery ( promptTextBox . Text , modelPicker . Text ) ;
257
278
258
279
return new CopilotUI ( )
259
280
{
260
- Control = grid ,
261
- Input = inputTextBox ,
281
+ Control = outerGrid ,
282
+ Input = promptTextBox ,
262
283
ModelPicker = modelPicker ,
263
284
} ;
264
285
}
0 commit comments