Switch to WPF.
Former-commit-id: e75aa871e3fecbe716c8dc49a348148d1bedf7f3
This commit is contained in:
76
installer/installtool/MainWindow.xaml.cs
Normal file
76
installer/installtool/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace installtool
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
private UIElement currentPanel_;
|
||||
private LicenseAccept licensePanel_;
|
||||
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
welcomeLabel_.Text = welcomeLabel_.Text.Replace("{Version}", Program.VersionString);
|
||||
welcomeText_.Text = welcomeText_.Text.Replace("{Version}", Program.VersionString);
|
||||
currentPanel_ = welcomePanel_;
|
||||
}
|
||||
|
||||
private void closeButton__Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
|
||||
private void swap(UIElement to)
|
||||
{
|
||||
currentPanel_.Visibility = Visibility.Hidden;
|
||||
to.Visibility = Visibility.Visible;
|
||||
currentPanel_ = to;
|
||||
}
|
||||
|
||||
private void backButton__Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (currentPanel_ == licensePanel_)
|
||||
{
|
||||
swap(welcomePanel_);
|
||||
}
|
||||
}
|
||||
|
||||
private void nextButton__Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (licensePanel_ == null || currentPanel_ == welcomePanel_)
|
||||
{
|
||||
if (licensePanel_ == null)
|
||||
{
|
||||
licensePanel_ = new LicenseAccept();
|
||||
contentPanel_.Children.Add(licensePanel_);
|
||||
}
|
||||
swap(licensePanel_);
|
||||
}
|
||||
|
||||
if (currentPanel_ != welcomePanel_)
|
||||
{
|
||||
backButton_.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user