Skip to content

Commit 0cf7fa7

Browse files
committed
Fix PageNubmerDisplay
1 parent ff7b986 commit 0cf7fa7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Flow.Launcher/WelcomeWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
HorizontalAlignment="Center"
110110
VerticalAlignment="Center"
111111
FontSize="14"
112-
Text="1/5"
112+
Text="{Binding PageDisplay, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
113113
TextAlignment="Center" />
114114
</StackPanel>
115115

Flow.Launcher/WelcomeWindow.xaml.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public WelcomeWindow(Settings settings)
2828
InitializeComponent();
2929
BackButton.IsEnabled = false;
3030
this.settings = settings;
31+
3132
pages = new()
3233
{
3334
new WelcomePage1(settings),
@@ -38,11 +39,16 @@ public WelcomeWindow(Settings settings)
3839
};
3940
ContentFrame.Navigate(pages[0]);
4041
}
42+
4143
private int page;
44+
private int pageNum = 1;
4245
private int MaxPage = 5;
46+
public string PageDisplay => $"{pageNum}/5";
4347

4448
private void UpdateView()
4549
{
50+
pageNum = page + 1;
51+
PageNavigation.Text = PageDisplay;
4652
if (page == 0)
4753
{
4854
BackButton.IsEnabled = false;
@@ -84,7 +90,6 @@ private void BackwardButton_Click(object sender, RoutedEventArgs e)
8490
}
8591
}
8692

87-
public string PageDisplay => $"{page}/5";
8893
private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
8994
{
9095
Close();

0 commit comments

Comments
 (0)