-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQueryViewModel.cs
34 lines (29 loc) · 1.04 KB
/
QueryViewModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using boss.client.win.common.controls;
namespace boss.client.win
{
public class QueryViewModel : AbstractQueryViewModel
{
private readonly string labelTail;
public QueryViewModel(string queryCode) : base(queryCode, $"ui.{queryCode}")
{
labelTail = Application.Current.TryFindResource("message.label.tail") as string ?? string.Empty;
}
protected override FrameworkElement CreateParameterContent(Parameter parameter)
{
return InputBox.Of(parameter);
}
protected override FrameworkElement CreateParameterHeader(Parameter parameter)
{
return new Label() { Content = parameter.description + labelTail };
}
protected override IDictionary<string, object> GetQueryArguments()
{
var inputBoxes = GetInputBoxes();
return inputBoxes.ToDictionary(x => x.GetName(), x => x.GetValue());
}
}
}