|
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;
using System.Collections.ObjectModel;
namespace nPuzzel
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
PuzzelControl pc;
ObservableCollection<int> dimensions = new ObservableCollection<int>();
public MainWindow()
{
InitializeComponent();
for (int i = 3; i < 10; i++)
{
dimensions.Add(i);
}
dimensionCombo.ItemsSource = dimensions;
dimensionCombo.SelectedIndex = 1;
}
private void imageCheckBox_Checked(object sender, RoutedEventArgs e)
{
pc.UseImage(true);
}
private void imageCheckBox_Unchecked(object sender, RoutedEventArgs e)
{
pc.UseImage(false);
}
private void dimensionCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
pc = new PuzzelControl(Convert.ToInt32(dimensionCombo.SelectedValue), @"pack://application:,,,/images/green.jpg");
mainGrid.Children.Clear();
mainGrid.Children.Add(pc);
}
private void resetButton_Click(object sender, RoutedEventArgs e)
{
pc = new PuzzelControl(Convert.ToInt32(dimensionCombo.SelectedValue), @"pack://application:,,,/images/green.jpg");
mainGrid.Children.Clear();
mainGrid.Children.Add(pc);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am a full-stack developer. My skills include JavaScript, C#/.Net, MS Azure cloud etc. I love to work on complex programming tasks requiring deep analysis, planning and use of efficient algorithms and data structures.