Skip to content

Commit

Permalink
PropertyGrid dialog and window style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kikipoulet committed Dec 11, 2024
1 parent 05c6ecf commit 59d82a1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 17 deletions.
37 changes: 22 additions & 15 deletions SukiUI.Demo/Features/ControlsLibrary/PropertyGridView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,10 @@
</UserControl.Resources>

<WrapPanel Classes="PageContainer" Orientation="Horizontal">
<suki:GlassCard Width="500">
<ScrollViewer>
<DockPanel>
<suki:GlassCard Padding="12" Margin="0,0,0,25" DockPanel.Dock="Top" HorizontalAlignment="Right">
<StackPanel Orientation="Horizontal" Spacing="12">
<TextBlock Margin="8,0,0,0" VerticalAlignment="Center" FontWeight="DemiBold" Text="Use external dialog window :"></TextBlock>
<ToggleSwitch
IsChecked="True"
IsCheckedChanged="ToggleButton_OnIsCheckedChanged" />
</StackPanel>
</suki:GlassCard>


<suki:GlassCard Width="500">
<ScrollViewer>

<suki:PropertyGrid Item="{Binding Form}">
<suki:PropertyGrid.DataTemplates>
<!--
Expand All @@ -36,10 +28,24 @@
<StaticResource ResourceKey="PropertyGridTemplateSelector" />
</suki:PropertyGrid.DataTemplates>
</suki:PropertyGrid>
</DockPanel>
</ScrollViewer>
</suki:GlassCard>

</ScrollViewer>
</suki:GlassCard>


<StackPanel Spacing="0">
<suki:GlassCard Width="400" Padding="17" Margin="0,15,0,17" DockPanel.Dock="Top" HorizontalAlignment="Right">
<Panel >
<StackPanel Spacing="18" Margin="8,0,0,5" >
<TextBlock VerticalAlignment="Center" FontSize="16" Margin="0,8,0,0" FontWeight="DemiBold" Text="Child Dialog"></TextBlock>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Foreground="{DynamicResource SukiLowText}" Text="Show children objects in a SukiUI dialog instead of a new window. Useful for applications running in a window-less environment."></TextBlock>

</StackPanel>
<ToggleSwitch HorizontalAlignment="Right" VerticalAlignment="Top"
IsChecked="True"
IsCheckedChanged="ToggleButton_OnIsCheckedChanged" />
</Panel>
</suki:GlassCard>
<suki:GlassCard Width="400">
<suki:GroupBox Header="Form Output">
<ScrollViewer>
Expand Down Expand Up @@ -67,5 +73,6 @@
</ScrollViewer>
</suki:GroupBox>
</suki:GlassCard>
</StackPanel>
</WrapPanel>
</UserControl>
12 changes: 11 additions & 1 deletion SukiUI/Controls/PropertyGrid/PropertyGridDialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@
Background="{DynamicResource SukiBackground}"
mc:Ignorable="d">

<Border Padding="5" Background="{DynamicResource SukiBackground}">
<Border Padding="0" Background="{DynamicResource SukiBackground}">
<Panel>
<ScrollViewer>
<controls:PropertyGrid Item="{Binding}">
<controls:PropertyGrid.DataTemplates>

<DataTemplate DataType="controls:CategoryViewModel">
<controls:GlassCard Padding="15,15,15,5" Margin="0,10">
<Expander Grid.IsSharedSizeScope="True"
Header="{Binding DisplayName}"
IsExpanded="True">
<ItemsControl Margin="7,0,0,20" ItemsSource="{Binding Properties}" />
</Expander>
</controls:GlassCard>
</DataTemplate>

<!--
replace the PropertyGridTemplateSelector with your own type or subclass it,
if you want to customize the datatemplates being used
Expand Down
12 changes: 11 additions & 1 deletion SukiUI/Controls/PropertyGrid/PropertyGridWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@
Background="{DynamicResource SukiBackground}"
mc:Ignorable="d">

<Border Padding="5" Background="{DynamicResource SukiBackground}">
<Border Padding="18" Background="{DynamicResource SukiBackground}">
<ScrollViewer>
<controls:PropertyGrid Item="{Binding}">
<controls:PropertyGrid.DataTemplates>

<DataTemplate DataType="controls:CategoryViewModel">
<controls:GlassCard Padding="15,15,15,5" Margin="10">
<Expander Grid.IsSharedSizeScope="True"
Header="{Binding DisplayName}"
IsExpanded="True">
<ItemsControl Margin="7,0,0,20" ItemsSource="{Binding Properties}" />
</Expander>
</controls:GlassCard>
</DataTemplate>

<!--
replace the PropertyGridTemplateSelector with your own type or subclass it,
if you want to customize the datatemplates being used
Expand Down

0 comments on commit 59d82a1

Please sign in to comment.