Skip to content

Commit a173ee2

Browse files
committed
Added more XamlDisplayerPanel
-but for TextFields there are some bug - the textfield is not displaying properly
1 parent c697852 commit a173ee2

File tree

7 files changed

+313
-500
lines changed

7 files changed

+313
-500
lines changed

MainDemo.Wpf/Buttons.xaml

Lines changed: 85 additions & 258 deletions
Large diffs are not rendered by default.

MainDemo.Wpf/Buttons.xaml.cs

Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.IO;
34
using System.Linq;
45
using System.Text;
56
using System.Threading.Tasks;
@@ -12,53 +13,65 @@
1213
using System.Windows.Media.Imaging;
1314
using System.Windows.Navigation;
1415
using System.Windows.Shapes;
16+
using System.Xml;
17+
using CodeDisplayer;
1518
using MaterialDesignColors.WpfExample.Domain;
1619

1720
namespace MaterialDesignColors.WpfExample
1821
{
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();
2730

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+
}
3043

31-
public ICommand FloatingActionDemoCommand { get; }
44+
public ICommand FloatingActionDemoCommand { get; }
3245

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+
}
3750

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.");
4154
}
4255

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+
}
4760

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+
}
5265

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;
5770

58-
var next = int.Parse(CountingBadge.Badge.ToString()) + 1;
71+
var next = int.Parse(CountingBadge.Badge.ToString()) + 1;
5972

60-
CountingBadge.Badge = next < 21 ? (object)next : null;
73+
CountingBadge.Badge = next < 21 ? (object)next : null;
6174

62-
}
63-
}
75+
}
76+
}
6477
}

MainDemo.Wpf/Cards.xaml.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using System.Windows.Navigation;
1515
using System.Windows.Shapes;
1616
using System.Xml;
17+
using CodeDisplayer;
1718

1819
namespace MaterialDesignColors.WpfExample
1920
{
@@ -25,15 +26,15 @@ public partial class Cards : UserControl
2526
public Cards()
2627
{
2728
InitializeComponent();
28-
var xmlDoc = new XmlDocument();
29-
string source = File.ReadAllText(@"..\..\Cards.xaml");
30-
xmlDoc.LoadXml(source);
31-
//XmlDocument xmlDoc=
32-
// new MaterialDesignInXamlToolkitGitHubFile(
33-
// ownerName: "wongjiahau",
34-
// branchName: "New-Demo-2",
35-
// fileName: "Cards.xaml")
36-
// .GetXmlDocument();
29+
//var xmlDoc = new XmlDocument();
30+
//string source = File.ReadAllText(@"..\..\Cards.xaml");
31+
//xmlDoc.LoadXml(source);
32+
XmlDocument xmlDoc =
33+
new MaterialDesignInXamlToolkitGitHubFile(
34+
ownerName: "wongjiahau" ,
35+
branchName: "New-Demo-2" ,
36+
fileName: "Cards.xaml")
37+
.GetXmlDocument();
3738
XamlDisplayerPanel.Initialize(xmlDoc);
3839
}
3940

Binary file not shown.

MainDemo.Wpf/Sliders.xaml.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ public partial class Sliders : UserControl
2626
public Sliders()
2727
{
2828
InitializeComponent();
29-
var xmlDoc = new XmlDocument();
30-
xmlDoc.Load(@"..\..\Sliders.xaml");
31-
//XmlDocument xmlDoc=
32-
// new MaterialDesignInXamlToolkitGitHubFile(
33-
// ownerName: "wongjiahau",
34-
// branchName: "New-Demo-2",
35-
// fileName: "Sliders.xaml")
36-
// .GetXmlDocument();
29+
//var xmlDoc = new XmlDocument();
30+
//xmlDoc.Load(@"..\..\Sliders.xaml");
31+
XmlDocument xmlDoc =
32+
new MaterialDesignInXamlToolkitGitHubFile(
33+
ownerName: "wongjiahau" ,
34+
branchName: "New-Demo-2" ,
35+
fileName: "Sliders.xaml")
36+
.GetXmlDocument();
3737
XamlDisplayerPanel.Initialize(xmlDoc);
3838
}
3939

0 commit comments

Comments
 (0)