feat: SectionPanel

Add scroll flugs
Add carusel scroll
Add animation
This commit is contained in:
2026-02-10 15:03:23 +03:00
parent b638d4e752
commit 40aa38d353
4 changed files with 174 additions and 51 deletions
+2
View File
@@ -17,6 +17,8 @@ public partial class MainViewModel : ViewModelBase
[ObservableProperty] private IRelayCommand _buttonUpClick;
[ObservableProperty] private IRelayCommand _buttonDownClick;
[ObservableProperty] private int _currentIndex;
[ObservableProperty] private bool _canScrollForward;
[ObservableProperty] private bool _canScrollBackward;
public MainViewModel(ILogger<MainViewModel> logger, CameraViewModel cameraViewModel, ResourcesViewModel resourcesViewModel, CameraService cameraService)
{
+3 -3
View File
@@ -7,9 +7,9 @@
x:DataType="local_vm:MainViewModel"
x:Class="GSS2.Test.Views.MainView">
<Grid ColumnDefinitions="*,100" RowDefinitions="*,*">
<Button Grid.Row="0" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Command="{Binding ButtonUpClick}"/>
<Button Grid.Row="1" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Command="{Binding ButtonDownClick}"/>
<core:SectionPanel Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" CurrentIndex="{Binding CurrentIndex}">
<Button Grid.Row="0" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" IsEnabled="{Binding CanScrollBackward}" Command="{Binding ButtonUpClick}"/>
<Button Grid.Row="1" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" IsEnabled="{Binding CanScrollForward}" Command="{Binding ButtonDownClick}"/>
<core:SectionPanel Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" ClipToBounds="True" CanScrollForward="{Binding CanScrollForward}" CanScrollBackward="{Binding CanScrollBackward}" CurrentIndex="{Binding CurrentIndex}">
<ContentControl VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Content="{Binding ResourcesViewModel}" />
<ContentControl VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Content="{Binding CameraViewModel}" />
<Grid ColumnDefinitions="100, *">