ScriptHome.xaml 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <UserControl x:Class="TeamAAS_VP.Views.DebugMod.ScriptHome"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:prism="http://prismlibrary.com/"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.DebugMod"
  8. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  9. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  10. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  11. xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
  12. xmlns:control="clr-namespace:TeamAAS_VP.Controls"
  13. prism:ViewModelLocator.AutoWireViewModel="True"
  14. xmlns:AvalonEdit="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
  15. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  16. lex:LocalizeDictionary.DesignCulture="zh-CN"
  17. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  18. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  19. FontFamily="{DynamicResource DefaultFont}"
  20. mc:Ignorable="d"
  21. d:Background="White"
  22. d:DataContext="{d:DesignInstance Type=vm:ScriptHomeViewModel}">
  23. <b:Interaction.Triggers>
  24. <b:EventTrigger EventName="Loaded">
  25. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  26. </b:EventTrigger>
  27. </b:Interaction.Triggers>
  28. <UserControl.Resources>
  29. <ResourceDictionary>
  30. </ResourceDictionary>
  31. </UserControl.Resources>
  32. <Grid>
  33. <Grid.RowDefinitions>
  34. <RowDefinition Height="auto" />
  35. <RowDefinition Height="*" />
  36. </Grid.RowDefinitions>
  37. <StackPanel Grid.Row="0"
  38. Orientation="Horizontal">
  39. <TextBlock Text="{lex:Loc 脚本文件,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  40. VerticalAlignment="Center" />
  41. <ComboBox x:Name="cmbScript"
  42. VerticalAlignment="Center"
  43. SelectedItem="{Binding SelectScript,Mode=TwoWay}"
  44. ItemsSource="{Binding ScriptFilesCollection}"
  45. materialDesign:HintAssist.Hint="{lex:Loc 选择脚本文件}"
  46. materialDesign:TextFieldAssist.HasClearButton="True"
  47. Margin="5,0">
  48. <b:Interaction.Triggers>
  49. <b:EventTrigger EventName="SelectionChanged">
  50. <b:InvokeCommandAction Command="{Binding SelectScriptCommand}"
  51. CommandParameter="{Binding ElementName=cmbScript,Path=SelectedItem}" />
  52. </b:EventTrigger>
  53. </b:Interaction.Triggers>
  54. <ComboBox.ItemTemplate>
  55. <DataTemplate>
  56. <StackPanel Orientation="Horizontal">
  57. <materialDesign:PackIcon Kind="ScriptOutline" />
  58. <TextBlock Text="{Binding}" />
  59. </StackPanel>
  60. </DataTemplate>
  61. </ComboBox.ItemTemplate>
  62. </ComboBox>
  63. <Button Content="{lex:Loc 新建脚本}"
  64. VerticalAlignment="Center"
  65. Command="{Binding CreateFileCommand}" />
  66. <Button Content="{lex:Loc 移除脚本}"
  67. VerticalAlignment="Center"
  68. Margin="5,0"
  69. Command="{Binding DelectFileCommand}"
  70. CommandParameter="{Binding ElementName=cmbScript,Path=SelectedItem}" />
  71. </StackPanel>
  72. <control:ScriptEditControl Grid.Row="1"
  73. IsEnabled="{Binding IsSelected}"
  74. Text="{Binding Scripting,Mode=TwoWay}"
  75. CompileType="BackgroundScripting"
  76. ScriptPath="{Binding ScriptingFilePath,Mode=TwoWay}">
  77. <b:Interaction.Triggers>
  78. <b:EventTrigger EventName="OnSaveScript">
  79. <b:InvokeCommandAction Command="{Binding SaveScriptCommand}" />
  80. </b:EventTrigger>
  81. </b:Interaction.Triggers>
  82. </control:ScriptEditControl>
  83. </Grid>
  84. </UserControl>