Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Commit a2d430b

Browse files
committed
.
1 parent 41b48ea commit a2d430b

8 files changed

Lines changed: 66 additions & 38 deletions

File tree

src/LXLDevHelper/Other/Font.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System.Windows;
2+
using System.Windows.Media;
3+
4+
namespace LXLDevHelper.Other
5+
{
6+
//public static class Font
7+
//{
8+
// public static ResourceKey IconFontStyleKey => new();
9+
// public static FontFamily GlobalFontFamily { get; set; } = new FontFamily("Microsoft YaHei");
10+
//}
11+
}

src/LXLDevHelper/ViewModels/LXLFuncParams.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ public class LXLFuncParamsBase : BindableBase
1818
"string"
1919
#else
2020
""
21+
#endif
22+
;
23+
/// <summary>
24+
/// 参数名称
25+
/// </summary>
26+
public string ParamName { get => _paramName; set => SetProperty(ref _paramName, value); }
27+
private string _paramName =
28+
#if DEBUG
29+
"参数名"
30+
#else
31+
""
2132
#endif
2233
;
2334
/// <summary>
@@ -34,17 +45,6 @@ public class LXLFuncParams : LXLFuncParamsBase
3445
{
3546

3647
/// <summary>
37-
/// 参数名称
38-
/// </summary>
39-
public string ParamName { get => _paramName; set => SetProperty(ref _paramName, value); }
40-
private string _paramName =
41-
#if DEBUG
42-
"参数名"
43-
#else
44-
""
45-
#endif
46-
;
47-
/// <summary>
4848
/// 参数描述
4949
/// </summary>
5050
public string Description { get => _description; set => SetProperty(ref _description, value); }

src/LXLDevHelper/ViewModels/LXLFunction.cs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ namespace LXLDevHelper.ViewModels
77
public class LXLFunctionBase : BindableBase
88
{
99
/// <summary>
10-
/// 方法描述
11-
/// </summary>
12-
public string Description { get => _description; set => SetProperty(ref _description, value); }
13-
private string _description =
14-
#if DEBUG
15-
"方法描述"
16-
#else
17-
""
18-
#endif
19-
;
20-
/// <summary>
2110
/// 返回值类型
2211
/// </summary>
2312
public string ReturnType { get => _returnType; set => SetProperty(ref _returnType, value); }
@@ -41,7 +30,17 @@ public class LXLFunctionAnonymous : LXLFunctionBase
4130
public class LXLFunction : LXLFunctionBase
4231
{
4332
[JsonIgnore] public LXLFunction Me { get => this; }
44-
33+
/// <summary>
34+
/// 方法描述
35+
/// </summary>
36+
public string Description { get => _description; set => SetProperty(ref _description, value); }
37+
private string _description =
38+
#if DEBUG
39+
"方法描述"
40+
#else
41+
""
42+
#endif
43+
;
4544
/// <summary>
4645
/// 方法名
4746
/// </summary>

src/LXLDevHelper/Views/EditFunctionWIndow.xaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
ui:WindowHelper.UseModernWindowStyle="True"
1111
mc:Ignorable="d" Topmost="True"
1212
WindowStyle="ToolWindow"
13-
Title="EditFunctionWIndow" Height="250" Width="400">
13+
Title="EditFunctionWIndow" Height="250" Width="400"
14+
FontFamily="Microsoft YaHei"
15+
>
1416
<Window.Resources >
1517
<Style TargetType="TextBox" BasedOn="{StaticResource ComboBoxTextBoxStyle}">
1618
<Setter Property="ui:ControlHelper.CornerRadius" Value="0" />
19+
<Setter Property="FontFamily" Value="Red" />
1720
</Style>
1821
<Style x:Key="DataTextBlock" TargetType="TextBlock" BasedOn="{StaticResource DataGridTextBlockStyle}">
1922
<Setter Property="Padding" Value="5,0,0,0" />
@@ -34,7 +37,7 @@
3437

3538
<Grid>
3639
<DockPanel>
37-
<Grid DockPanel.Dock="Bottom" Margin="5">
40+
<Grid DockPanel.Dock="Bottom" Margin="5">
3841
<Grid.ColumnDefinitions>
3942
<ColumnDefinition Width="1*"/>
4043
<ColumnDefinition Width="10"/>
@@ -43,7 +46,7 @@
4346
<Button Content="取消" HorizontalAlignment="Stretch" Click="CancelButton_Click"/>
4447
<Button Content="保存" Grid.Column="2" HorizontalAlignment="Stretch" Click="SaveButton_Click"/>
4548
</Grid>
46-
<DataGrid DockPanel.Dock="Top" Name="ParamsDataGrid" CanUserSortColumns="False" ItemsSource="{Binding Func.Params}" AutoGenerateColumns="False" CanUserResizeColumns="True" CanUserResizeRows="False">
49+
<DataGrid DockPanel.Dock="Top" Name="ParamsDataGrid" CanUserSortColumns="False" ItemsSource="{Binding Func.Params}" AutoGenerateColumns="False" CanUserResizeColumns="True" CanUserResizeRows="False">
4750
<DataGrid.ContextMenu>
4851
<ContextMenu StaysOpen="true">
4952
<MenuItem Header="添加" Click="AddParams_Click" />
@@ -53,7 +56,8 @@
5356
</DataGrid.ContextMenu>
5457
<DataGrid.Columns>
5558
<DataGridCheckBoxColumn Width ="44" Header="可选" Binding="{Binding Optional}" CanUserResize="False" HeaderStyle="{StaticResource DateTimePickerFlyoutButtonStyle}"/>
56-
<DataGridTemplateColumn Width ="6*" Header="类型" HeaderStyle="{StaticResource DateTimePickerFlyoutButtonStyle}">
59+
<DataGridTextColumn Width ="2*" Header="参数名" Binding="{Binding ParamName}" HeaderStyle="{StaticResource DateTimePickerFlyoutButtonStyle}" EditingElementStyle="{StaticResource EditingTextbox}" ElementStyle="{StaticResource DataTextBlock}"/>
60+
<DataGridTemplateColumn Width ="3*" Header="类型" HeaderStyle="{StaticResource DateTimePickerFlyoutButtonStyle}">
5761
<DataGridTemplateColumn.CellTemplate>
5862
<DataTemplate>
5963
<TextBlock Text="{Binding ParamType,Mode=TwoWay}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,0,0"/>

src/LXLDevHelper/Views/EditFunctionWIndow.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public string Result
4343
if (edited)
4444
{
4545
try
46-
{
46+
{
4747
//ShowWarn("Function@" + Newtonsoft.Json.JsonConvert.SerializeObject(Data, Newtonsoft.Json.Formatting.None));
48-
return "Function@" + Newtonsoft.Json.JsonConvert.SerializeObject(Data, Newtonsoft.Json.Formatting.None);
48+
return "Function@" + JsonConvert.SerializeObject(Data, Formatting.None);
4949
}
5050
catch (System.Exception ex) { ShowWarn("保存方法参数出错\n" + ex.ToString()); }
5151
}

src/LXLDevHelper/Views/MainContent.xaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@
158158
<ComboBox.ToolTip>
159159
<StackPanel>
160160
<TextBlock Text="选择或手动输入类型"/>
161-
<TextBlock Text="右键下拉框箭头位置编辑匿名函数"/>
161+
<TextBlock Text="右键下拉框箭头位置编辑匿名函数"/>
162+
<TextBlock Text="当前内容:"/>
163+
<TextBlock Text="{Binding CurrentFunc.ReturnType,Mode=OneWay}" TextWrapping="Wrap"/>
162164
</StackPanel>
163165
</ComboBox.ToolTip>
164166
<ComboBox.ContextMenu>
@@ -201,6 +203,8 @@
201203
<StackPanel>
202204
<TextBlock Text="选择或手动输入类型"/>
203205
<TextBlock Text="右键下拉框箭头位置编辑匿名函数"/>
206+
<TextBlock Text="当前内容:"/>
207+
<TextBlock Text="{Binding ParamType,Mode=OneWay}" TextWrapping="Wrap"/>
204208
</StackPanel>
205209
</ComboBox.ToolTip>
206210
<ComboBox.ContextMenu>
@@ -245,6 +249,8 @@
245249
<StackPanel>
246250
<TextBlock Text="选择或手动输入类型"/>
247251
<TextBlock Text="右键下拉框箭头位置编辑匿名函数"/>
252+
<TextBlock Text="当前内容:"/>
253+
<TextBlock Text="{Binding CurrentProperty.PropertyType,Mode=OneWay}" TextWrapping="Wrap"/>
248254
</StackPanel>
249255
</ComboBox.ToolTip>
250256
<ComboBox.ContextMenu>

src/LXLDevHelper/Views/MainWindow.xaml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@
1111
WindowStartupLocation="CenterScreen"
1212
Title="LXL接口编辑器"
1313
Height="450"
14-
Width="800">
15-
<Grid>
16-
<DockPanel DockPanel.Dock="Top" HorizontalAlignment="Right" VerticalAlignment="Top">
17-
<ui:ToggleSwitch FontSize="16" AutomationProperties.HelpText="置顶" IsOn="False" OffContent="置顶" OnContent="已置顶" Toggled="TopToggleSwitch_Toggled" Margin="0,0,-40,0"/>
18-
<ui:ToggleSwitch FontSize="16" AutomationProperties.HelpText="切换主题" IsOn="True" OffContent="Light Theme" OnContent="Dark Theme" Toggled="DarkLight_Toggled"/>
19-
</DockPanel>
20-
<ContentControl prism:RegionManager.RegionName="ContentRegion"/>
21-
</Grid>
14+
Width="800"
15+
FontFamily="Microsoft YaHei"
16+
TextElement.FontFamily="Microsoft YaHei"
17+
>
18+
<!--<DockPanel>
19+
<ui:TitleBarControl DockPanel.Dock="Top">
20+
</ui:TitleBarControl>-->
21+
<Grid>
22+
<DockPanel DockPanel.Dock="Top" HorizontalAlignment="Right" VerticalAlignment="Top">
23+
<ui:ToggleSwitch FontSize="16" AutomationProperties.HelpText="置顶" IsOn="False" OffContent="置顶" OnContent="已置顶" Toggled="TopToggleSwitch_Toggled" Margin="0,0,-40,0"/>
24+
<ui:ToggleSwitch FontSize="16" AutomationProperties.HelpText="切换主题" IsOn="True" OffContent="Light Theme" OnContent="Dark Theme" Toggled="DarkLight_Toggled"/>
25+
</DockPanel>
26+
<ContentControl prism:RegionManager.RegionName="ContentRegion"/>
27+
</Grid>
28+
<!--</DockPanel>-->
2229
</Window>

src/LXLDevHelper/Views/MainWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public MainWindow(IContainerExtension container, IRegionManager regionManager)
1515
_container = container;
1616
_regionManager = regionManager;
1717
regionManager.RegisterViewWithRegion("ContentRegion", typeof(MainContent));
18+
//SystemFonts.MessageFontFamily = FontFamily;
1819
}
1920

2021
private delegate void MethodInvoker();

0 commit comments

Comments
 (0)