Skip to content

Commit

Permalink
bug+
Browse files Browse the repository at this point in the history
  • Loading branch information
HeBianGu committed Mar 5, 2024
1 parent 746bb0e commit e4786da
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 41 deletions.
5 changes: 3 additions & 2 deletions Source/Controls/H.Controls.Form/Form.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,6 @@ protected void RefreshObjectinternal()
}

PropertyInfo[] ps = l.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

if (ps != null)
propertys.AddRange(ps);

Expand All @@ -1142,7 +1141,9 @@ protected void RefreshObjectinternal()
action.Invoke(type);
}
List<IPropertyItem> items = new List<IPropertyItem>();
foreach (PropertyInfo item in propertys)

var ss = propertys.Distinct();
foreach (PropertyInfo item in propertys.Distinct())
{
if (this.UseCommandOnly && !typeof(ICommand).IsAssignableFrom(item.PropertyType))
continue;
Expand Down
39 changes: 26 additions & 13 deletions Source/Controls/H.Controls.RepositoryBox/RepositoryGrid.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:h="https://github.com/HeBianGu"
xmlns:local="clr-namespace:H.Controls.RepositoryBox">
<Style BasedOn="{StaticResource {x:Static DataGridKeys.Default}}" TargetType="{x:Type local:RepositoryGrid}">
<Style BasedOn="{StaticResource {x:Static DataGridKeys.Default}}"
TargetType="{x:Type local:RepositoryGrid}">
<Setter Property="AutoGenerateColumns" Value="False" />
<Setter Property="ScrollViewer.CanContentScroll" Value="False" />
<Setter Property="UseAdd" Value="True" />
Expand All @@ -18,37 +19,48 @@
<Button Command="{Binding AddCommand}"
Content="新增"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UseAdd, Converter={x:Static h:Converter.GetTrueToVisible}}" />
<Button Command="{Binding ClearCommand}"
<Button Margin="2,0"
Command="{Binding ClearCommand}"
Content="清空"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UseClear, Converter={x:Static h:Converter.GetTrueToVisible}}" />
<Button Command="{Binding EditCommand}"
<Button Margin="2,0"
Command="{Binding EditCommand}"
Content="编辑"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UseEdit, Converter={x:Static h:Converter.GetTrueToVisible}}" />
<Button Command="{Binding DeleteCommand}"
<Button Margin="2,0"
Command="{Binding DeleteCommand}"
Content="删除"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UseDelete, Converter={x:Static h:Converter.GetTrueToVisible}}" />
<Button Command="{Binding ExportCommand}"
<Button Margin="2,0"
Command="{Binding ExportCommand}"
Content="导出"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UseExport, Converter={x:Static h:Converter.GetTrueToVisible}}" />
<Button Command="{Binding ViewCommand}"
<Button Margin="2,0"
Command="{Binding ViewCommand}"
Content="查看"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UseView, Converter={x:Static h:Converter.GetTrueToVisible}}" />
<Button Command="{Binding CheckedAllCommand}"
<Button Margin="2,0"
Command="{Binding CheckedAllCommand}"
Content="全选"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UseCheckAll, Converter={x:Static h:Converter.GetTrueToVisible}}" />
<Button Command="{Binding DeleteCheckedCommand}"
<Button Margin="2,0"
Command="{Binding DeleteCheckedCommand}"
Content="删除选中"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UseDeleteChecked, Converter={x:Static h:Converter.GetTrueToVisible}}" />
<Button Command="{Binding NextCommand}"
<Button Margin="2,0"
Command="{Binding NextCommand}"
Content="下一页"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UseNextPage, Converter={x:Static h:Converter.GetTrueToVisible}}" />
<Button Command="{Binding PreviousCommand}"
<Button Margin="2,0"
Command="{Binding PreviousCommand}"
Content="上一页"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UsePreviousPage, Converter={x:Static h:Converter.GetTrueToVisible}}" />
<Button Command="{Binding SaveCommand}"
<Button Margin="2,0"
Command="{Binding SaveCommand}"
Content="保存"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UseSave, Converter={x:Static h:Converter.GetTrueToVisible}}" />
<CheckBox Content="全选"
<CheckBox Margin="2,0"
Content="全选"
IsChecked="{Binding CheckedAll}"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:RepositoryGrid}, Path=UseCheckAll, Converter={x:Static h:Converter.GetTrueToVisible}}" />
</DockPanel>
Expand All @@ -58,7 +70,8 @@
<Setter Property="Cattach.BottomTemplate">
<Setter.Value>
<ControlTemplate>
<TextBlock Margin="10" DockPanel.Dock="Bottom">
<TextBlock Margin="10"
DockPanel.Dock="Bottom">
<Run Text=" 合计:" />
<Run Text="{Binding RelativeSource={RelativeSource AncestorType=DataGrid}, Path=ItemsSource.Count, Mode=OneWay}" />
<Run Text="/" />
Expand Down
3 changes: 1 addition & 2 deletions Source/Modules/H.Modules.Identity/UserViewPresenter.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
Header="昵称" />
<DataGridCheckBoxColumn Width="Auto"
Binding="{Binding Model.Enable}"
ElementStyle="{x:Null}"
Header="启用/禁用"
IsReadOnly="True" />
<DataGridTextColumn Width="*"
Expand All @@ -80,8 +81,6 @@
<DataGridTextColumn Width="*"
Binding="{Binding Model.Role}"
Header="角色" />


<DataGridTemplateColumn Width="*"
Header="权限列表">
<DataGridTemplateColumn.CellTemplate>
Expand Down
2 changes: 1 addition & 1 deletion Source/Styles/H.Styles.Default/Controls/TabControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
TargetType="{x:Type TabItem}">
<Setter Property="Height" Value="{DynamicResource {x:Static LayoutKeys.ItemHeight}}" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Padding" Value="12,2,12,2" />
<Setter Property="Padding" Value="5,2,0,2" />
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="Transparent" />
Expand Down
2 changes: 1 addition & 1 deletion Source/Tests/H.Test.Chart2D/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow"
Width="800"
Height="450"
Height="650"
Style="{StaticResource {x:Type Window}}"
mc:Ignorable="d">
<TabControl>
Expand Down
Loading

0 comments on commit e4786da

Please sign in to comment.