Skip to content

Commit

Permalink
bug+
Browse files Browse the repository at this point in the history
  • Loading branch information
HeBianGu committed Jan 31, 2024
1 parent c270449 commit f1908e3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 22 deletions.
4 changes: 4 additions & 0 deletions Source/Controls/H.Controls.Form/Form.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,10 @@ protected void RefreshObjectinternal()

public class StaticForm : Form
{
static StaticForm()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(StaticForm), new FrameworkPropertyMetadata(typeof(StaticForm)));
}
public override void RefreshObject()
{
this.RefreshObjectinternal();
Expand Down
20 changes: 12 additions & 8 deletions Source/Modules/H.Modules.About/AboutViewPresenter.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@
<DataTemplate DataType="{x:Type local:AboutViewPresenter}">
<Grid>
<h:StaticForm SelectObject="{Binding}"
UseBoolen="False"
UseEnum="False"
UseNull="False"
UsePropertyView="True" />
UseBoolen="False"
UseEnum="False"
UseNull="False"
UsePropertyView="True" />
<!--<TextBlock Text="关于页面" />-->
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsVisible}" Value="False">
<DataTrigger Binding="{Binding IsVisible}"
Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding IsAuthority}" Value="False">
<DataTrigger Binding="{Binding IsAuthority}"
Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</DataTemplate.Triggers>
Expand All @@ -29,10 +31,12 @@
M249.015232 843.178592c35.2 28.8 73.6 51.2 112 67.2 41.6-38.4 96-60.8 150.4-60.8 57.6 0 108.8 22.4 150.4 60.8 41.6-16 80-38.4 112-67.2-12.8-54.4-3.2-112 22.4-163.2 28.8-48 73.6-86.4 128-102.4 3.2-22.4 6.4-44.8 6.4-67.2 0-22.4-3.2-44.8-6.4-67.2-54.4-16-99.2-54.4-128-102.4-28.8-48-35.2-108.8-22.4-163.2-35.2-28.8-73.6-51.2-112-67.2-41.6 38.4-92.8 60.8-150.4 60.8-54.4 0-108.8-22.4-150.4-60.8-41.6 16-80 38.4-112 67.2 12.8 54.4 3.2 112-22.4 163.2-28.8 48-73.6 86.4-128 102.4-3.2 22.4-6.4 44.8-6.4 67.2 0 22.4 3.2 44.8 6.4 67.2 54.4 16 99.2 54.4 128 102.4C252.215232 731.178592 261.815232 788.778592 249.015232 843.178592M361.015232 958.378592c-54.4-19.2-105.6-48-150.4-89.6-6.4-6.4-9.6-16-6.4-22.4 16-48 9.6-99.2-16-140.8-25.6-44.8-64-73.6-112-83.2-9.6-3.2-16-9.6-16-19.2-6.4-28.8-9.6-60.8-9.6-89.6 0-28.8 3.2-57.6 9.6-89.6 3.2-9.6 9.6-16 16-19.2 48-12.8 89.6-41.6 112-83.2 25.6-44.8 28.8-92.8 16-140.8-3.2-9.6 0-19.2 6.4-22.4 44.8-38.4 96-67.2 150.4-89.6 9.6-3.2 16 0 22.4 6.4 35.2 35.2 80 57.6 128 57.6 48 0 96-19.2 128-57.6 6.4-6.4 16-9.6 22.4-6.4 54.4 19.2 105.6 48 150.4 89.6 6.4 6.4 9.6 16 6.4 22.4-16 48-9.6 99.2 16 140.8 25.6 44.8 64 73.6 112 83.2 9.6 3.2 16 9.6 16 19.2 6.4 28.8 9.6 60.8 9.6 89.6 0 28.8-3.2 57.6-9.6 89.6-3.2 9.6-9.6 16-16 19.2-48 12.8-89.6 41.6-112 83.2-25.6 44.8-28.8 92.8-16 140.8 3.2 9.6 0 19.2-6.4 22.4-44.8 38.4-96 67.2-150.4 89.6-9.6 3.2-16 0-22.4-6.4-35.2-35.2-80-57.6-128-57.6-48 0-96 19.2-128 57.6-3.2 3.2-9.6 6.4-16 6.4C364.215232 958.378592 361.015232 958.378592 361.015232 958.378592z
</Button>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsVisible}" Value="False">
<DataTrigger Binding="{Binding IsVisible}"
Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding IsAuthority}" Value="False">
<DataTrigger Binding="{Binding IsAuthority}"
Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</DataTemplate.Triggers>
Expand Down
8 changes: 4 additions & 4 deletions Source/Providers/H.Providers.Ioc/Ioc/DbIoc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public static void Rebuild()

public static T GetService<T>(bool throwIfNone = true)
{
T r = (T)_services.GetService(typeof(T));
T r = (T)_services?.GetService(typeof(T));
if (r == null && throwIfNone)
{
System.Ioc.GetService<T>(throwIfNone);
System.Diagnostics.Debug.WriteLine(typeof(T));
throw new ArgumentNullException($"请先注册<{typeof(T)}>接口");
return System.Ioc.GetService<T>(throwIfNone);
//System.Diagnostics.Debug.WriteLine(typeof(T));
//throw new ArgumentNullException($"请先注册<{typeof(T)}>接口");
}
return r;
}
Expand Down
25 changes: 15 additions & 10 deletions Source/Windows/H.Windows.Main/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
xmlns:local="clr-namespace:H.Windows.Main">

<Style TargetType="{x:Type local:MainWindow}">
<Setter Property="h:GridSplitterBox.MenuMaxWidth" Value="300" />
<Setter Property="h:GridSplitterBox.MenuMinWidth" Value="0" />
<Setter Property="h:GridSplitterBox.MenuMaxWidth" Value="200" />
<Setter Property="h:GridSplitterBox.MenuMinWidth" Value="50" />
<Setter Property="h:GridSplitterBox.IsExpanded" Value="False" />
<Setter Property="h:GridSplitterBox.Mode" Value="Extend" />
<Setter Property="h:GridSplitterBox.GridSpliteWidth" Value="2" />
Expand Down Expand Up @@ -33,7 +33,8 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:MainWindow}">
<Border x:Name="PART_Border" BorderThickness="{TemplateBinding BorderThickness}">
<Border x:Name="PART_Border"
BorderThickness="{TemplateBinding BorderThickness}">
<Border.BorderBrush>
<SolidColorBrush Color="{DynamicResource {x:Static ColorKeys.BorderBrush}}" />
</Border.BorderBrush>
Expand All @@ -51,11 +52,12 @@
<h:GridSplitterBox.MenuContent>
<Control Template="{TemplateBinding SideTemplate}" />
</h:GridSplitterBox.MenuContent>
<!--<h:GridSplitterBox.ToggleStyle>
<Style TargetType="ToggleButton" BasedOn="{x:Static h:GridSplitterKeys.to}">
<h:GridSplitterBox.ToggleStyle>
<Style BasedOn="{StaticResource {x:Static h:GridSplitterBox.ToggleKey}}"
TargetType="ToggleButton">
<Setter Property="Grid.ColumnSpan" Value="1" />
</Style>
</h:GridSplitterBox.ToggleStyle>-->
</h:GridSplitterBox.ToggleStyle>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{Binding RelativeSource={RelativeSource AncestorType=local:MainWindow}, Path=CaptionHeight}" />
Expand Down Expand Up @@ -94,10 +96,12 @@
</ControlTemplate>
</Button.Template>
</Button>
<TextBlock Margin="5,0" Text="{TemplateBinding Title}" />
<TextBlock Margin="5,0"
Text="{TemplateBinding Title}" />
</StackPanel>

<Control Grid.Column="1" Template="{TemplateBinding CaptionTempate}" />
<Control Grid.Column="1"
Template="{TemplateBinding CaptionTempate}" />

<StackPanel Grid.Column="2"
HorizontalAlignment="Right"
Expand Down Expand Up @@ -137,7 +141,8 @@
Grid.ColumnSpan="5"
Visibility="Collapsed">
<Border.Background>
<SolidColorBrush Opacity="0.3" Color="Black" />
<SolidColorBrush Opacity="0.3"
Color="Black" />
</Border.Background>
</Border>

Expand Down

0 comments on commit f1908e3

Please sign in to comment.