Skip to content

Commit 4ab8b58

Browse files
committed
Merge branch 'master' of https://github.com/thimmy687/MaterialDesignInXamlToolkit into thimmy687-master
2 parents 578210a + 8b70fea commit 4ab8b58

File tree

6 files changed

+23
-28
lines changed

6 files changed

+23
-28
lines changed

MainDemo.Wpf/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33
<startup>
44
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
55
</startup>
6+
<appSettings>
7+
<add key="GitHub" value="https://github.com/ButchersBoy/MaterialDesignInXamlToolkit"/>
8+
</appSettings>
69
</configuration>

MainDemo.Wpf/Domain/DocumentationLink.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Configuration;
23
using System.Windows;
34
using System.Windows.Controls;
45
using System.Windows.Input;
@@ -22,14 +23,14 @@ public DocumentationLink(DocumentationLinkType type, string url, string label)
2223
public static DocumentationLink WikiLink(string page, string label)
2324
{
2425
return new DocumentationLink(DocumentationLinkType.Wiki,
25-
"https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/wiki/" + page, label);
26+
$"{ConfigurationManager.AppSettings["GitHub"]}/wiki/" + page, label);
2627
}
2728

2829
public static DocumentationLink StyleLink(string nameChunk)
2930
{
3031
return new DocumentationLink(
3132
DocumentationLinkType.StyleSource,
32-
$"https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/blob/master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.{nameChunk}.xaml",
33+
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.{nameChunk}.xaml",
3334
nameChunk);
3435
}
3536

@@ -39,7 +40,7 @@ public static DocumentationLink ApiLink<TClass>(string subNamespace)
3940

4041
return new DocumentationLink(
4142
DocumentationLinkType.ControlSource,
42-
$"https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/blob/master/MaterialDesignThemes.Wpf/{subNamespace}/{typeName}.cs",
43+
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MaterialDesignThemes.Wpf/{subNamespace}/{typeName}.cs",
4344
typeName);
4445
}
4546

@@ -50,7 +51,7 @@ public static DocumentationLink ApiLink<TClass>()
5051

5152
return new DocumentationLink(
5253
DocumentationLinkType.ControlSource,
53-
$"https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/blob/master/MaterialDesignThemes.Wpf/{typeName}.cs",
54+
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MaterialDesignThemes.Wpf/{typeName}.cs",
5455
typeName);
5556
}
5657

@@ -67,7 +68,7 @@ public static DocumentationLink DemoPageLink<TDemoPage>(string label)
6768

6869
return new DocumentationLink(
6970
DocumentationLinkType.DemoPageSource,
70-
$"https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/blob/master/MainDemo.Wpf/{typeof(TDemoPage).Name}.{ext}",
71+
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MainDemo.Wpf/{typeof(TDemoPage).Name}.{ext}",
7172
label ?? typeof(TDemoPage).Name);
7273
}
7374

MainDemo.Wpf/Domain/ListFieldsViewModel.cs renamed to MainDemo.Wpf/Domain/ListsAndGridsViewModel.cs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
using System.Collections.ObjectModel;
33
using System.ComponentModel;
44
using System.Runtime.CompilerServices;
5-
using System.Windows.Controls;
5+
using MaterialDesignColors.WpfExample.Domain;
66

7-
namespace MaterialDesignColors.WpfExample.Domain
7+
namespace MaterialDesignDemo.Domain
88
{
99
public class ListsAndGridsViewModel : INotifyPropertyChanged
1010
{
@@ -36,7 +36,7 @@ public bool? IsAllItems3Selected
3636
}
3737
}
3838

39-
private void SelectAll(bool select, IEnumerable<SelectableViewModel> models)
39+
private static void SelectAll(bool select, IEnumerable<SelectableViewModel> models)
4040
{
4141
foreach (var model in models)
4242
{
@@ -70,28 +70,16 @@ private static ObservableCollection<SelectableViewModel> CreateData()
7070
};
7171
}
7272

73-
public ObservableCollection<SelectableViewModel> Items1
74-
{
75-
get { return _items1; }
76-
}
73+
public ObservableCollection<SelectableViewModel> Items1 => _items1;
74+
public ObservableCollection<SelectableViewModel> Items2 => _items2;
7775

78-
public ObservableCollection<SelectableViewModel> Items2
79-
{
80-
get { return _items2; }
81-
}
82-
83-
public ObservableCollection<SelectableViewModel> Items3
84-
{
85-
get { return _items3; }
86-
}
76+
public ObservableCollection<SelectableViewModel> Items3 => _items3;
8777

8878
public event PropertyChangedEventHandler PropertyChanged;
8979

9080
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
9181
{
92-
if (PropertyChanged != null)
93-
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
94-
//PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
82+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
9583
}
9684

9785
public IEnumerable<string> Foods

MainDemo.Wpf/Domain/MainWindowViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using MaterialDesignDemo;
1+
using System.Configuration;
2+
using MaterialDesignDemo;
23
using MaterialDesignDemo.Domain;
34
using MaterialDesignThemes.Wpf;
45
using MaterialDesignThemes.Wpf.Transitions;
@@ -15,7 +16,7 @@ public MainWindowViewModel()
1516
new DemoItem("Home", new Home(),
1617
new []
1718
{
18-
new DocumentationLink(DocumentationLinkType.Wiki, "https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/wiki", "WIKI"),
19+
new DocumentationLink(DocumentationLinkType.Wiki, $"{ConfigurationManager.AppSettings["GitHub"]}/wiki", "WIKI"),
1920
DocumentationLink.DemoPageLink<Home>()
2021
}
2122
),

MainDemo.Wpf/Home.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Configuration;
34
using System.Diagnostics;
45
using System.Linq;
56
using System.Text;
@@ -28,7 +29,7 @@ public Home()
2829

2930
private void GitHubButton_OnClick(object sender, RoutedEventArgs e)
3031
{
31-
Process.Start("https://github.com/ButchersBoy/MaterialDesignInXamlToolkit");
32+
Process.Start(ConfigurationManager.AppSettings["GitHub"]);
3233
}
3334

3435
private void TwitterButton_OnClick(object sender, RoutedEventArgs e)

MainDemo.Wpf/MaterialDesignDemo.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
</Compile>
5454
<Reference Include="PresentationFramework.Aero2" />
5555
<Reference Include="System" />
56+
<Reference Include="System.Configuration" />
5657
<Reference Include="System.Data" />
5758
<Reference Include="System.Xml" />
5859
<Reference Include="Microsoft.CSharp" />
@@ -99,7 +100,7 @@
99100
<Compile Include="Domain\NotifyPropertyChangedExtension.cs" />
100101
<Compile Include="Domain\DemoItem.cs" />
101102
<Compile Include="Domain\DialogsViewModel.cs" />
102-
<Compile Include="Domain\ListFieldsViewModel.cs" />
103+
<Compile Include="Domain\ListsAndGridsViewModel.cs" />
103104
<Compile Include="Domain\Sample4Dialog.xaml.cs">
104105
<DependentUpon>Sample4Dialog.xaml</DependentUpon>
105106
</Compile>

0 commit comments

Comments
 (0)