Skip to content

Commit 923c108

Browse files
committed
feat(expander): Expand if tabBar selection does change
1 parent 6d14faa commit 923c108

16 files changed

+105
-50
lines changed

src/DevTKSS.Extensions.Uno.Storage/DevTKSS.Extensions.Uno.Storage.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
<Description>Extensions that are extending Uno Platform functionallities</Description>
1111
</PropertyGroup>
1212
<ItemGroup>
13-
<PackageReference Include="Uno.Core" />
14-
<PackageReference Include="Uno.Core.Extensions" />
15-
<PackageReference Include="Uno.Core.Extensions.Collections" />
13+
<PackageReference Include="Uno.Core.Extensions" />
1614
<PackageReference Include="Uno.Extensions.Storage" />
1715
</ItemGroup>
1816
</Project>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
global using DevTKSS.Extensions.Uno.Storage.Enumerable;
2-
global using DevTKSS.Extensions.Uno.Storage;
1+
global using DevTKSS.Extensions.Uno.Storage.Enumerable;

src/DevTKSS.Uno.Samples.MvuxGallery/DevTKSS.Uno.Samples.MvuxGallery.csproj

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,14 @@
4949
</PropertyGroup>
5050
<ItemGroup>
5151
<PackageReference Include="CommunityToolkit.WinUI.Converters" />
52-
<ProjectReference Include="..\DevTKSS.Extensions.Uno\DevTKSS.Extensions.Uno.csproj" />
5352
</ItemGroup>
5453
<ItemGroup>
5554
<UnoImage Include="Assets\Images\*" />
56-
<Resource Include="Assets\Samples\*" CopyToOutputDirectory="PreserveNewest" />
55+
<Resource Include="Assets\Samples\*.txt" CopyToOutputDirectory="PreserveNewest" />
5756
<UnoSplashScreen Include="Assets\SplashScreens\*" />
5857
</ItemGroup>
5958
<ItemGroup>
60-
<Compile Update="Presentation\Views\SimpleListPage.xaml.cs">
61-
<DependentUpon>SimpleListPage.xaml</DependentUpon>
62-
</Compile>
63-
</ItemGroup>
64-
<ItemGroup>
65-
<Page Update="Presentation\Views\SimpleListPage.xaml">
66-
<Generator>MSBuild:Compile</Generator>
67-
</Page>
59+
<ProjectReference Include="..\DevTKSS.Extensions.Uno.Storage\DevTKSS.Extensions.Uno.Storage.csproj" />
6860
</ItemGroup>
6961

7062
</Project>

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/DashboardModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public async ValueTask SwitchCodeSampleAsync([FeedParameter(nameof(SelectedOptio
125125
{
126126
await Task.Delay(1, ct);
127127
return new HeaderContent(ImageLocation: "Assets/Images/styled_logo.png",
128-
Caption: _stringLocalizer["ListViewTitle"]);
128+
Caption: _stringLocalizer["GridViewTitle"]);
129129
});
130130
#endregion
131131

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/CounterPage.xaml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
Margin="12"
4747
Width="{x:Bind spCounterContent.Width, Mode=OneWay}"/>
4848
</StackPanel>
49-
<Expander Grid.Row="1"
49+
<Expander x:Name="CodeSampleExpander"
50+
Grid.Row="1"
5051
MaxHeight="400"
5152
ExpandDirection="Down"
5253
VerticalAlignment="Bottom"
@@ -55,21 +56,19 @@
5556
ContentTemplate="{StaticResource CodeSampleWrappedTextblock}"
5657
Content="{Binding CurrentCodeSample}">
5758

58-
<Expander.HeaderTemplate>
59-
<DataTemplate>
60-
<utu:TabBar VerticalAlignment="Bottom"
61-
HorizontalAlignment="Stretch"
62-
Orientation="Horizontal"
63-
HorizontalContentAlignment="Stretch"
64-
SelectionIndicatorTransitionMode="Slide"
65-
ItemsSource="{Binding CodeSampleOptions, Mode=TwoWay}"
66-
ItemTemplate="{StaticResource BottomTabBarItemTemplate}"
67-
utu:CommandExtensions.Command="{Binding SwitchCodeSampleAsync}"
68-
utu:CommandExtensions.CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self},Path=SelectedItem, UpdateSourceTrigger=PropertyChanged}">
69-
</utu:TabBar>
70-
</DataTemplate>
71-
</Expander.HeaderTemplate>
72-
59+
<Expander.Header>
60+
<utu:TabBar x:Name="CodeSampleTabBar"
61+
VerticalAlignment="Bottom"
62+
HorizontalAlignment="Stretch"
63+
Orientation="Horizontal"
64+
HorizontalContentAlignment="Stretch"
65+
SelectionIndicatorTransitionMode="Slide"
66+
ItemsSource="{Binding CodeSampleOptions, Mode=TwoWay}"
67+
ItemTemplate="{StaticResource BottomTabBarItemTemplate}"
68+
utu:CommandExtensions.Command="{Binding SwitchCodeSampleAsync}"
69+
utu:CommandExtensions.CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self},Path=SelectedItem, UpdateSourceTrigger=PropertyChanged}">
70+
</utu:TabBar>
71+
</Expander.Header>
7372
</Expander>
7473
</Grid>
7574
</Page>

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/CounterPage.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,12 @@ public sealed partial class CounterPage : Page
77
public CounterPage()
88
{
99
this.InitializeComponent();
10+
this.CodeSampleTabBar.SelectionChanged += (s, e) =>
11+
{
12+
if (this.CodeSampleTabBar.SelectedIndex > -1)
13+
{
14+
this.CodeSampleExpander.IsExpanded = true;
15+
}
16+
};
1017
}
1118
}

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/DashboardPage.xaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
</DataTemplate>
4747
</mvux:FeedView.ValueTemplate>
4848
</mvux:FeedView>
49-
<Expander Grid.Row="1"
49+
<Expander x:Name="CodeSampleExpander"
50+
Grid.Row="1"
5051
MaxHeight="400"
5152
ExpandDirection="Down"
5253
VerticalAlignment="Bottom"
@@ -56,7 +57,8 @@
5657
ContentTemplate="{StaticResource CodeSampleWrappedTextblock}">
5758

5859
<Expander.Header>
59-
<utu:TabBar VerticalAlignment="Bottom"
60+
<utu:TabBar x:Name="CodeSampleTabBar"
61+
VerticalAlignment="Bottom"
6062
Orientation="Horizontal"
6163
HorizontalAlignment="Stretch"
6264
SelectionIndicatorTransitionMode="Slide"

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/DashboardPage.xaml.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ public sealed partial class DashboardPage : Page
44
public DashboardPage()
55
{
66
this.InitializeComponent();
7-
7+
this.CodeSampleTabBar.SelectionChanged += (s, e) =>
8+
{
9+
if (this.CodeSampleTabBar.SelectedIndex > -1)
10+
{
11+
this.CodeSampleExpander.IsExpanded = true;
12+
}
13+
};
814
}
915

1016
private double DevideByTwo(double value)

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/ListboardPage.xaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
</mvux:FeedView.ValueTemplate>
4242
</mvux:FeedView>
4343

44-
<Expander Grid.Row="1"
44+
<Expander x:Name="CodeSampleExpander"
45+
Grid.Row="1"
4546
MaxHeight="400"
4647
ExpandDirection="Down"
4748
VerticalAlignment="Bottom"
@@ -51,7 +52,8 @@
5152
Content="{Binding CurrentCodeSample}">
5253

5354
<Expander.Header>
54-
<utu:TabBar VerticalAlignment="Bottom"
55+
<utu:TabBar x:Name="CodeSampleTabBar"
56+
VerticalAlignment="Bottom"
5557
Orientation="Horizontal"
5658
HorizontalAlignment="Stretch"
5759
HorizontalContentAlignment="Center"

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/ListboardPage.xaml.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ public sealed partial class ListboardPage : Page
55
public ListboardPage()
66
{
77
this.InitializeComponent();
8-
8+
this.CodeSampleTabBar.SelectionChanged += (s, e) =>
9+
{
10+
if (this.CodeSampleTabBar.SelectedIndex > -1)
11+
{
12+
this.CodeSampleExpander.IsExpanded = true;
13+
}
14+
};
915
}
1016
}

0 commit comments

Comments
 (0)