aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml
blob: 5fcaea2ea1aefcf8add0d56f79f49bf15845663f (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
<UserControl x:Class="Tango.FSE.MachineConfiguration.Dialogs.DataStoreItemEditDialogView"
             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:local="clr-namespace:Tango.FSE.MachineConfiguration.Dialogs"
             xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common"
             xmlns:sharedControls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:datastore="clr-namespace:Tango.DataStore;assembly=Tango.DataStore"
             xmlns:pmr="clr-namespace:Tango.PMR.Common;assembly=Tango.PMR"
             xmlns:pmrds="clr-namespace:Tango.PMR.DataStore;assembly=Tango.PMR"
             mc:Ignorable="d" 
             Width="400" Height="500" d:DataContext="{d:DesignInstance Type=local:DataStoreItemEditDialogViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}">
    <Grid Margin="10">
        <DockPanel>
            <StackPanel DockPanel.Dock="Top" >
                <StackPanel Orientation="Horizontal">
                    <material:PackIcon Width="40" Height="40" Kind="Key"  />
                    <TextBlock Margin="10 0 0 0" FontSize="{StaticResource FSE_LargerFontSize}" VerticalAlignment="Center" Text="{Binding Item.Key}"></TextBlock>
                </StackPanel>
            </StackPanel>

            <StackPanel Margin="0 10 0 0" DockPanel.Dock="Top">
                <TextBlock FontSize="{StaticResource FSE_SmallerFontSize}" Foreground="{StaticResource FSE_GrayBrush}">Data Type</TextBlock>

                <DockPanel>
                    <Button Visibility="{Binding Type,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Proto'}" DockPanel.Dock="Right" Style="{StaticResource FSE_RaisedButton_Dark_Hover_Accent_Foreground}" Margin="5 5 0 0" Padding="10 0" FontSize="{StaticResource FSE_SmallFontSize}" Height="20" VerticalAlignment="Center" Command="{Binding InitProtoCommand}" ToolTip="Create the basic structure for this proto message">Init</Button>
                    <Button Visibility="{Binding Type,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Bytes'}" DockPanel.Dock="Right" Style="{StaticResource FSE_RaisedButton_Dark_Hover_Accent_Foreground}" Margin="5 5 0 0" Padding="10 0" FontSize="{StaticResource FSE_SmallFontSize}" Height="20" VerticalAlignment="Center" Command="{Binding LoadFileCommand}" ToolTip="Load bytes from file">Load File</Button>
                    <controls:FSERoundedCornersComboBox IsEnabled="{Binding EnableTypeChange}" FontSize="{StaticResource FSE_SmallFontSize}" Margin="0 5 0 0" ItemsSource="{Binding Source={x:Type datastore:DataType},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding Type,Mode=TwoWay}" SelectedValuePath="Value" DisplayMemberPath="DisplayName"></controls:FSERoundedCornersComboBox>
                </DockPanel>

                <StackPanel Margin="0 10 0 0" Visibility="{Binding Type,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Proto'}">
                    <TextBlock Foreground="{StaticResource FSE_GrayBrush}" FontSize="{StaticResource FSE_SmallerFontSize}">Message Type</TextBlock>
                    <sharedControls:SearchComboBox IsEnabled="{Binding EnableTypeChange}" FontSize="{StaticResource FSE_SmallFontSize}" Margin="0 -5 5 0" ItemsSource="{Binding Source={x:Type pmrds:DataStoreMessageType},Converter={StaticResource EnumToItemsSourceConverter},ConverterParameter='false'}" SelectedItem="{Binding ProtoMessageType,Mode=TwoWay}"></sharedControls:SearchComboBox>
                </StackPanel>
            </StackPanel>

            <DockPanel DockPanel.Dock="Bottom" Margin="0 5 0 0" MinHeight="15">
                <DockPanel Visibility="{Binding HasError,Converter={StaticResource BooleanToVisibilityConverter}}">
                    <material:PackIcon Margin="0 0 0 0" VerticalAlignment="Top" Kind="Alert" Foreground="{StaticResource FSE_ErrorBrush}" Width="12" Height="12" />
                    <TextBlock Foreground="{StaticResource FSE_ErrorBrush}" Margin="5 0 0 0" Text="{Binding Error}" FontSize="{StaticResource FSE_SmallerFontSize}" TextWrapping="Wrap"></TextBlock>
                </DockPanel>
            </DockPanel>

            <Grid Margin="0 10 0 0">
                <TextBox Style="{StaticResource FSE_Rounded_Corners_TextBox_Multiline}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" TextWrapping="NoWrap" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" FontSize="{StaticResource FSE_SmallFontSize}" Text="{Binding EditingValue,UpdateSourceTrigger=PropertyChanged}">

                </TextBox>
            </Grid>

        </DockPanel>
    </Grid>
</UserControl>