Skip to content

Commit

Permalink
delayed loading of language combobox in welcome page
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Jul 26, 2023
1 parent 893480d commit eedd8de
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
28 changes: 24 additions & 4 deletions Starward/Pages/Welcome/SelectLanguagePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,35 @@
VerticalAlignment="Center"
Source="ms-appx:///Assets/Image/ImgTheSecondWorldBg.png"
Stretch="UniformToFill" />

<Image Grid.ColumnSpan="2"
HorizontalAlignment="Left"
Source="ms-appx:///Assets/Image/ImgTheSecondWorldBoss.png"
Stretch="Uniform" />

<Grid Name="Grid_OverMask"
Grid.ColumnSpan="2"
Background="{ThemeResource CustomOverlayAcrylicBrush}"
IsHitTestVisible="False"
Loaded="Grid_OverMask_Loaded" />



<Grid Grid.Column="1"
<Grid Name="Grid_Setting"
Grid.Column="1"
Margin="0,48,48,96"
Padding="24,12,24,12"
HorizontalAlignment="Left"
VerticalAlignment="Center"
x:Load="{x:Bind SettingGridLoad}"
Background="{ThemeResource CustomOverlayAcrylicBrush}"
CornerRadius="8">
CornerRadius="8"
Shadow="{ThemeResource ThemeShadow}"
Translation="0,0,16">
<Grid.Transitions>
<TransitionCollection>
<EntranceThemeTransition FromVerticalOffset="-1000" />
</TransitionCollection>
</Grid.Transitions>
<StackPanel Spacing="8">
<TextBlock FontSize="20"
FontWeight="SemiBold"
Expand All @@ -47,7 +62,6 @@
MinWidth="300"
DropDownClosed="ComboBox_Language_DropDownClosed"
DropDownOpened="ComboBox_Language_DropDownOpened"
SelectedIndex="0"
SelectionChanged="ComboBox_Language_SelectionChanged" />

<TextBlock Margin="0,8,0,0"
Expand Down Expand Up @@ -164,12 +178,18 @@
Margin="48"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
x:Load="{x:Bind SettingGridLoad}"
BorderThickness="0"
Command="{x:Bind NextCommand}"
CornerRadius="20"
Shadow="{ThemeResource ThemeShadow}"
Style="{ThemeResource AccentButtonStyle}"
Translation="0,0,8">
<Button.Transitions>
<TransitionCollection>
<EntranceThemeTransition FromHorizontalOffset="1000" />
</TransitionCollection>
</Button.Transitions>
<StackPanel Margin="20,0,20,0"
Orientation="Horizontal"
Spacing="16">
Expand Down
13 changes: 11 additions & 2 deletions Starward/Pages/Welcome/SelectLanguagePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ public SelectLanguagePage()
}



[ObservableProperty]
private bool settingGridLoad;


private async void Page_Loaded(object sender, RoutedEventArgs e)
{
await Task.Delay(16);
await Task.Delay(480);
SettingGridLoad = true;
InitializeLanguageComboBox();
_welcomeService.ApiCDNIndex = AppConfig.ApiCDNIndex;
switch (AppConfig.ApiCDNIndex)
Expand All @@ -68,6 +70,13 @@ private async void Page_Loaded(object sender, RoutedEventArgs e)
}



private void Grid_OverMask_Loaded(object sender, RoutedEventArgs e)
{
Grid_OverMask.Visibility = Visibility.Collapsed;
}


private bool enableSelectionChanged = false;


Expand Down

0 comments on commit eedd8de

Please sign in to comment.