blob: 5c58488994261413daa2d0b8c83ea9697b89510f (
plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
<UserControl x:Class="Tango.FSE.Procedures.Dialogs.UserInputDialogView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common"
xmlns:local="clr-namespace:Tango.FSE.Procedures.Dialogs"
mc:Ignorable="d"
Width="500" Height="Auto" MaxHeight="500" d:DataContext="{d:DesignInstance Type=local:UserInputDialogViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}">
<Grid Margin="10">
<DockPanel>
<StackPanel DockPanel.Dock="Top" >
<StackPanel Orientation="Horizontal">
<material:PackIcon Kind="EventEdit" Width="32" Height="32" />
<TextBlock Margin="10 0 0 0" FontSize="{StaticResource FSE_LargeFontSize}" VerticalAlignment="Center" Text="{Binding Title}"></TextBlock>
</StackPanel>
<TextBlock Margin="42 0 40 0" TextWrapping="Wrap" Text="{Binding Message}" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}"></TextBlock>
</StackPanel>
<Border Margin="0 20 0 0" >
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Padding="10">
<ItemsControl ItemsSource="{Binding Parameters}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<DockPanel Margin="0 10">
<material:PackIcon Kind="Pen" />
<StackPanel Margin="10 0 0 0">
<TextBlock Margin="2 0 0 0" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Name}"></TextBlock>
<ContentControl Content="{Binding}" Margin="0 2 0 0">
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBox Padding="5" Style="{StaticResource FSE_Rounded_Corners_TextBox}" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
</DataTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding TypeName}" Value="Boolean">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<DockPanel>
<ToggleButton x:Name="chkInput" Cursor="Hand" IsChecked="{Binding Value}" FocusVisualStyle="{x:Null}" HorizontalAlignment="Left" />
<Rectangle VerticalAlignment="Center" Margin="10 0 0 0">
<Rectangle.Style>
<Style TargetType="Rectangle">
<Setter Property="Stroke" Value="{StaticResource FSE_BorderBrush}">
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=chkInput,Path=IsChecked}" Value="True">
<Setter Property="Stroke" Value="{StaticResource FSE_PrimaryAccentBrush}"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
</Rectangle>
</DockPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IsEnum}" Value="True">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<controls:FSERoundedCornersComboBox Height="29" ItemsSource="{Binding Type,Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding Value,Mode=TwoWay}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" />
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</StackPanel>
</DockPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
</DockPanel>
</Grid>
</UserControl>
|