Skip to content

Commit 1e3c804

Browse files
authored
Merge pull request #26 from ButchersBoy/master
update from original repo
2 parents 88829e2 + b9962ed commit 1e3c804

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1219
-259
lines changed

.paket/paket.exe

112 KB
Binary file not shown.

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/Cards.xaml

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@
180180
pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Flipper.xaml
181181
-->
182182
<StackPanel>
183-
<materialDesign:Flipper Style="{StaticResource MaterialDesignCardFlipper}" Margin="4 4 0 0">
183+
<materialDesign:Flipper Style="{StaticResource MaterialDesignCardFlipper}" Margin="4 4 0 0"
184+
IsFlippedChanged="Flipper_OnIsFlippedChanged">
184185
<materialDesign:Flipper.FrontContent>
185186
<Button Style="{StaticResource MaterialDesignFlatButton}"
186187
Command="{x:Static materialDesign:Flipper.FlipCommand}"
@@ -257,5 +258,55 @@
257258
</materialDesign:Flipper.BackContent>
258259
</materialDesign:Flipper>
259260
</StackPanel>
261+
262+
<materialDesign:Flipper Style="{StaticResource MaterialDesignCardFlipper}" Margin="4 4 0 0">
263+
<materialDesign:Flipper.FrontContent>
264+
<Button Style="{StaticResource MaterialDesignFlatButton}"
265+
Command="{x:Static materialDesign:Flipper.FlipCommand}"
266+
Margin="8"
267+
Width="192"
268+
>RESIZING...</Button>
269+
</materialDesign:Flipper.FrontContent>
270+
<materialDesign:Flipper.BackContent>
271+
<Grid Height="256" Width="200">
272+
<Grid.RowDefinitions>
273+
<RowDefinition Height="Auto" />
274+
<RowDefinition Height="*" />
275+
</Grid.RowDefinitions>
276+
<materialDesign:ColorZone Mode="Accent" Padding="6">
277+
<StackPanel Orientation="Horizontal">
278+
<Button Style="{StaticResource MaterialDesignToolForegroundButton}"
279+
Command="{x:Static materialDesign:Flipper.FlipCommand}"
280+
HorizontalAlignment="Left">
281+
<materialDesign:PackIcon Kind="ArrowLeft" HorizontalAlignment="Right" />
282+
</Button>
283+
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">EDIT USER</TextBlock>
284+
</StackPanel>
285+
</materialDesign:ColorZone>
286+
<Grid Grid.Row="1" Margin="0 6 0 0" HorizontalAlignment="Center" VerticalAlignment="Top"
287+
Width="172">
288+
<Grid.RowDefinitions>
289+
<RowDefinition />
290+
<RowDefinition />
291+
<RowDefinition />
292+
<RowDefinition />
293+
</Grid.RowDefinitions>
294+
<TextBox materialDesign:HintAssist.Hint="First name" materialDesign:HintAssist.IsFloating="True"
295+
Margin="0 12 0 0">James</TextBox>
296+
<TextBox Grid.Row="1" materialDesign:HintAssist.Hint="Last name" materialDesign:HintAssist.IsFloating="True"
297+
Margin="0 12 0 0">Willock</TextBox>
298+
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0 12 0 0" HorizontalAlignment="Right">
299+
<TextBlock VerticalAlignment="Center">Email Contact</TextBlock>
300+
<ToggleButton Margin="8 0 0 0"></ToggleButton>
301+
</StackPanel>
302+
<StackPanel Grid.Row="3" Orientation="Horizontal" Margin="0 12 0 0" HorizontalAlignment="Right">
303+
<TextBlock VerticalAlignment="Center">Telephone Contact</TextBlock>
304+
<ToggleButton Margin="8 0 0 0"></ToggleButton>
305+
</StackPanel>
306+
</Grid>
307+
</Grid>
308+
</materialDesign:Flipper.BackContent>
309+
</materialDesign:Flipper>
310+
260311
</WrapPanel>
261312
</UserControl>

MainDemo.Wpf/Cards.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@ public Cards()
2424
{
2525
InitializeComponent();
2626
}
27+
28+
private void Flipper_OnIsFlippedChanged(object sender, RoutedPropertyChangedEventArgs<bool> e)
29+
{
30+
System.Diagnostics.Debug.WriteLine("Card is flipped = " + e.NewValue);
31+
}
2732
}
2833
}

MainDemo.Wpf/Domain/DocumentationLink.cs

Lines changed: 12 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

@@ -60,14 +61,20 @@ public static DocumentationLink DemoPageLink<TDemoPage>()
6061
}
6162

6263
public static DocumentationLink DemoPageLink<TDemoPage>(string label)
64+
{
65+
return DemoPageLink<TDemoPage>(label, null);
66+
}
67+
68+
public static DocumentationLink DemoPageLink<TDemoPage>(string label, string nameSpace)
6369
{
6470
var ext = typeof(UserControl).IsAssignableFrom(typeof(TDemoPage))
6571
? "xaml"
6672
: "cs";
6773

74+
6875
return new DocumentationLink(
6976
DocumentationLinkType.DemoPageSource,
70-
$"https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/blob/master/MainDemo.Wpf/{typeof(TDemoPage).Name}.{ext}",
77+
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MainDemo.Wpf/{(string.IsNullOrWhiteSpace(nameSpace) ? "" : ("/" + nameSpace + "/" ))}{typeof(TDemoPage).Name}.{ext}",
7178
label ?? typeof(TDemoPage).Name);
7279
}
7380

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: 4 additions & 3 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
),
@@ -107,7 +108,7 @@ public MainWindowViewModel()
107108
new []
108109
{
109110
DocumentationLink.DemoPageLink<Lists>("Demo View"),
110-
DocumentationLink.DemoPageLink<ListsAndGridsViewModel>("Demo View Model"),
111+
DocumentationLink.DemoPageLink<ListsAndGridsViewModel>("Demo View Model", "Domain"),
111112
DocumentationLink.StyleLink("ListBox"),
112113
DocumentationLink.StyleLink("ListView")
113114
})

MainDemo.Wpf/Expander.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@
4848
</Expander>
4949
</StackPanel>
5050
<materialDesign:Card Grid.Row="1" Background="{DynamicResource MaterialDesignBackground}"
51-
Margin="0 24 0 0">
51+
Margin="4 24 0 0">
5252
<StackPanel>
5353
<Expander HorizontalAlignment="Stretch"
54-
Header="Expander Example 2a">
54+
Header="Expander Example 2a">
5555
<StackPanel Orientation="Vertical"
5656
TextBlock.Foreground="{DynamicResource MaterialDesignBody}"
5757
Margin="24,8,24,16">

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)