SmartCellEditor.xaml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <UserControl x:Class="Aitex.UI.RecipeEditor.SmartCellEditor"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:Aitex.UI.RecipeEditor"
  7. mc:Ignorable="d"
  8. xmlns:xceed="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
  9. d:DesignHeight="20" d:DesignWidth="20" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
  10. <UserControl.Resources>
  11. <local:VisibilityConverter x:Key="visConverter" />
  12. <local:TimeSpanConverter x:Key="timeSpanConverter" />
  13. <local:NumConverter x:Key="numConverter" />
  14. <local:BoolConverter x:Key="boolConverter" />
  15. <local:BoolToVisibilityConverter x:Key="boolToVisibilityConverter"/>
  16. </UserControl.Resources>
  17. <StackPanel>
  18. <!--TextBlock-->
  19. <TextBlock x:Name="textBlock"
  20. Background="{Binding Background}"
  21. Foreground="{Binding Foreground}"
  22. Text="{Binding Path=Display,Mode=OneWay}"
  23. ToolTip="{Binding ToolTip}"
  24. FontWeight="{Binding FontWeight}"
  25. Visibility="{Binding Path=., Converter={StaticResource visConverter},ConverterParameter=TextBlock}"/>
  26. <!--Editable ComboBox-->
  27. <ComboBox x:Name="editableComboBox" ItemsSource="{Binding RecipeVariableDefine.DropdownItemList}" IsEditable="True"
  28. DisplayMemberPath="Item2" Text="{Binding Value,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  29. Visibility="{Binding Path=., Converter={StaticResource visConverter},ConverterParameter=EditableComboBox}" />
  30. <!--Readonly ComboBox-->
  31. <ComboBox x:Name="readonlyComboBox" ItemsSource="{Binding RecipeVariableDefine.DropdownItemList}" IsEditable="False"
  32. DisplayMemberPath="Item2" SelectedValuePath="Item1" SelectedValue="{Binding Path=Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
  33. Visibility="{Binding Path=., Converter={StaticResource visConverter},ConverterParameter=ReadonlyComboBox}" />
  34. <!--Text Input TextBox-->
  35. <TextBox HorizontalContentAlignment="Left" Text="{Binding Value}" Visibility="{Binding Path=., Converter={StaticResource visConverter},ConverterParameter=TextBox}" TextAlignment="Left" />
  36. <!--Number Input TextBox-->
  37. <!--<DockPanel LastChildFill="True" Visibility="{Binding Path=., Converter={StaticResource visConverter},ConverterParameter=DecimalUpDown}" >
  38. <CheckBox Margin="10,0,0,0" DockPanel.Dock="Right" Content="Jump" IsChecked="{Binding IsJump}" Visibility="{Binding Path=ShowsJumpControl, Converter={StaticResource boolToVisibilityConverter}}"/>-->
  39. <xceed:DecimalUpDown HorizontalAlignment="Stretch" FormatString="G" Value="{Binding Path=Value,Converter={StaticResource numConverter},Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Increment="1" TextAlignment="Left"
  40. Visibility="{Binding Path=., Converter={StaticResource visConverter},ConverterParameter=DecimalUpDown}"/>
  41. <!--</DockPanel>-->
  42. <!--CheckBox-->
  43. <CheckBox x:Name="checkBox" Content="{Binding Tag}" IsChecked="{Binding Path=Value,Converter={StaticResource boolConverter},Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding Path=., Converter={StaticResource visConverter},ConverterParameter=CheckBox}" />
  44. <!--TimePicker-->
  45. <xceed:DateTimeUpDown HorizontalContentAlignment="Left" Format="Custom" FormatString="HH:mm:ss" Value="{Binding Path=Value,Converter={StaticResource timeSpanConverter},Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding Path=., Converter={StaticResource visConverter},ConverterParameter=TimePicker}" CultureInfo="uk-UA" />
  46. <!--EndPoint-->
  47. <Button x:Name="endPoint" HorizontalAlignment="Stretch" Padding="0" Margin="0" VerticalAlignment="Stretch" Content="EndPoint" Command="{Binding EndPointCommand}" Visibility="{Binding Path=., Converter={StaticResource visConverter},ConverterParameter=EndPoint}" />
  48. </StackPanel>
  49. </UserControl>