|
1 | 1 | using System;
|
2 | 2 | using System.Collections.Generic;
|
| 3 | +using System.IO; |
3 | 4 | using System.Linq;
|
4 | 5 | using System.Text;
|
5 | 6 | using System.Threading.Tasks;
|
|
12 | 13 | using System.Windows.Media.Imaging;
|
13 | 14 | using System.Windows.Navigation;
|
14 | 15 | using System.Windows.Shapes;
|
| 16 | +using System.Xml; |
| 17 | +using CodeDisplayer; |
15 | 18 | using MaterialDesignColors.WpfExample.Domain;
|
16 | 19 |
|
17 | 20 | namespace MaterialDesignColors.WpfExample
|
18 | 21 | {
|
19 |
| - /// <summary> |
20 |
| - /// Interaction logic for Buttons.xaml |
21 |
| - /// </summary> |
22 |
| - public partial class Buttons : UserControl |
23 |
| - { |
24 |
| - public Buttons() |
25 |
| - { |
26 |
| - InitializeComponent(); |
| 22 | + /// <summary> |
| 23 | + /// Interaction logic for Buttons.xaml |
| 24 | + /// </summary> |
| 25 | + public partial class Buttons : UserControl |
| 26 | + { |
| 27 | + public Buttons() |
| 28 | + { |
| 29 | + InitializeComponent(); |
27 | 30 |
|
28 |
| - FloatingActionDemoCommand = new AnotherCommandImplementation(Execute); |
29 |
| - } |
| 31 | + FloatingActionDemoCommand = new AnotherCommandImplementation(Execute); |
| 32 | + var xmlDoc = new XmlDocument(); |
| 33 | + string source = File.ReadAllText(@"..\..\Buttons.xaml"); |
| 34 | + xmlDoc.LoadXml(source); |
| 35 | + //XmlDocument xmlDoc = |
| 36 | + // new MaterialDesignInXamlToolkitGitHubFile( |
| 37 | + // ownerName: "wongjiahau" , |
| 38 | + // branchName: "New-Demo-2" , |
| 39 | + // fileName: "Buttons.xaml") |
| 40 | + // .GetXmlDocument(); |
| 41 | + XamlDisplayerPanel.Initialize(xmlDoc); |
| 42 | + } |
30 | 43 |
|
31 |
| - public ICommand FloatingActionDemoCommand { get; } |
| 44 | + public ICommand FloatingActionDemoCommand { get; } |
32 | 45 |
|
33 |
| - private void Execute(object o) |
34 |
| - { |
35 |
| - Console.WriteLine("Floating action button command. - " + (o ?? "NULL").ToString()); |
36 |
| - } |
| 46 | + private void Execute(object o) |
| 47 | + { |
| 48 | + Console.WriteLine("Floating action button command. - " + (o ?? "NULL").ToString()); |
| 49 | + } |
37 | 50 |
|
38 |
| - private void ButtonBase_OnClick(object sender, RoutedEventArgs e) |
39 |
| - { |
40 |
| - Console.WriteLine("Just checking we haven't suppressed the button."); |
| 51 | + private void ButtonBase_OnClick(object sender, RoutedEventArgs e) |
| 52 | + { |
| 53 | + Console.WriteLine("Just checking we haven't suppressed the button."); |
41 | 54 | }
|
42 | 55 |
|
43 |
| - private void PopupBox_OnOpened(object sender, RoutedEventArgs e) |
44 |
| - { |
45 |
| - Console.WriteLine("Just making sure the popup has opened."); |
46 |
| - } |
| 56 | + private void PopupBox_OnOpened(object sender, RoutedEventArgs e) |
| 57 | + { |
| 58 | + Console.WriteLine("Just making sure the popup has opened."); |
| 59 | + } |
47 | 60 |
|
48 |
| - private void PopupBox_OnClosed(object sender, RoutedEventArgs e) |
49 |
| - { |
50 |
| - Console.WriteLine("Just making sure the popup has closed."); |
51 |
| - } |
| 61 | + private void PopupBox_OnClosed(object sender, RoutedEventArgs e) |
| 62 | + { |
| 63 | + Console.WriteLine("Just making sure the popup has closed."); |
| 64 | + } |
52 | 65 |
|
53 |
| - private void CountingButton_OnClick(object sender, RoutedEventArgs e) |
54 |
| - { |
55 |
| - if (CountingBadge.Badge == null || Equals(CountingBadge.Badge, "")) |
56 |
| - CountingBadge.Badge = 0; |
| 66 | + private void CountingButton_OnClick(object sender, RoutedEventArgs e) |
| 67 | + { |
| 68 | + if (CountingBadge.Badge == null || Equals(CountingBadge.Badge, "")) |
| 69 | + CountingBadge.Badge = 0; |
57 | 70 |
|
58 |
| - var next = int.Parse(CountingBadge.Badge.ToString()) + 1; |
| 71 | + var next = int.Parse(CountingBadge.Badge.ToString()) + 1; |
59 | 72 |
|
60 |
| - CountingBadge.Badge = next < 21 ? (object)next : null; |
| 73 | + CountingBadge.Badge = next < 21 ? (object)next : null; |
61 | 74 |
|
62 |
| - } |
63 |
| - } |
| 75 | + } |
| 76 | + } |
64 | 77 | }
|
0 commit comments