added samples
[windows-sources.git] / sdk / samples / WPFSamples / MenuItemCommandsAndEvents / csharp / window1.xaml.cs
bloba13a6f323d2d3f2cb9d594b97fab9ee4690410e2
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Windows;
5 using System.Windows.Controls;
6 using System.Windows.Data;
7 using System.Windows.Documents;
8 using System.Windows.Input;
9 using System.Windows.Media;
10 using System.Windows.Media.Imaging;
11 using System.Windows.Shapes;
14 namespace MenuItemCommands
16 /// <summary>
17 /// Interaction logic for Window1.xaml
18 /// </summary>
20 public partial class Window1 : System.Windows.Window
23 public Window1()
25 InitializeComponent();
29 private void Bold_Checked(object sender, RoutedEventArgs e)
31 textBox1.FontWeight = FontWeights.Bold;
34 private void Bold_Unchecked(object sender, RoutedEventArgs e)
36 textBox1.FontWeight = FontWeights.Normal;
39 private void Italic_Checked(object sender, RoutedEventArgs e)
41 textBox1.FontStyle = FontStyles.Italic;
44 private void Italic_Unchecked(object sender, RoutedEventArgs e)
46 textBox1.FontStyle = FontStyles.Normal;
49 private void IncreaseFont_Click(object sender, RoutedEventArgs e)
51 if (textBox1.FontSize < 18)
53 textBox1.FontSize += 2;
57 private void DecreaseFont_Click(object sender, RoutedEventArgs e)
59 if (textBox1.FontSize > 10)
61 textBox1.FontSize -= 2;