Skip to content

Commit 30bd8f2

Browse files
Merge pull request #113 from atc-net/feature/Support-readme-markdown-in-SampleViewer
Feature/support readme markdown in sample viewer
2 parents 3a90f5e + bcbcc8d commit 30bd8f2

Some content is hidden

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

54 files changed

+1758
-451
lines changed

README.md

+47-157
Large diffs are not rendered by default.

sample/Atc.Wpf.Sample/App.xaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,22 @@
1414
<ResourceDictionary Source="pack://application:,,,/Atc.Wpf.Controls;component/Styles/Controls.xaml" />
1515
</ResourceDictionary.MergedDictionaries>
1616

17+
<Style BasedOn="{StaticResource AtcApps.Styles.TreeViewItem}" TargetType="{x:Type TreeViewItem}">
18+
<Setter Property="IsExpanded" Value="True" />
19+
<Setter Property="FontWeight" Value="Bold" />
20+
<Setter Property="Foreground" Value="{DynamicResource AtcApps.Brushes.ThemeForeground4}" />
21+
</Style>
22+
23+
<Style BasedOn="{StaticResource AtcApps.Styles.TreeViewItem}" TargetType="{x:Type atc:SampleTreeViewItem}">
24+
<Setter Property="IsExpanded" Value="True" />
25+
<Setter Property="FontWeight" Value="Normal" />
26+
<Setter Property="Foreground" Value="{DynamicResource AtcApps.Brushes.ThemeForeground}" />
27+
</Style>
28+
1729
<Style BasedOn="{StaticResource AtcApps.Styles.TreeView}" TargetType="{x:Type sample:SamplesWpfTreeView}" />
1830
<Style BasedOn="{StaticResource AtcApps.Styles.TreeView}" TargetType="{x:Type sample:SamplesWpfControlsTreeView}" />
1931
<Style BasedOn="{StaticResource AtcApps.Styles.TreeView}" TargetType="{x:Type sample:SamplesWpfFontIconsTreeView}" />
2032
<Style BasedOn="{StaticResource AtcApps.Styles.TreeView}" TargetType="{x:Type sample:SamplesWpfThemingTreeView}" />
21-
<Style BasedOn="{StaticResource AtcApps.Styles.TreeViewItem}" TargetType="{x:Type atc:SampleTreeViewItem}" />
2233

2334
</ResourceDictionary>
2435
</Application.Resources>

sample/Atc.Wpf.Sample/App.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ await host
112112

113113
ThemeManager.Current.ChangeTheme(
114114
Current,
115-
"Dark.Blue");
115+
"Light.Blue");
116116

117117
var mainWindow = host
118118
.Services

sample/Atc.Wpf.Sample/MainWindow.xaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
DockPanel.Dock="Top"
3131
Focusable="True"
3232
TextChanged="SampleFilterOnTextChanged" />
33-
<TabControl DockPanel.Dock="Bottom" TabStripPlacement="Left">
33+
<TabControl
34+
Margin="0,0,5,10"
35+
DockPanel.Dock="Bottom"
36+
TabStripPlacement="Left">
3437
<TabItem Header="Wpf">
3538
<sample:SamplesWpfTreeView
3639
x:Name="StvSampleWpf"

sample/Atc.Wpf.Sample/SamplesWpf/Commands/RelayCommandAsyncView.xaml

+24-18
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,30 @@
2424
<GroupBox Header="Usage">
2525
<ScrollViewer>
2626

27-
<StackPanel Margin="10" Orientation="Vertical">
28-
<StackPanel Margin="10" Orientation="Vertical">
29-
<Button Command="{Binding Path=Test1Command}" Content="Button with no canExecute" />
30-
</StackPanel>
31-
<StackPanel Margin="10" Orientation="Vertical">
32-
<CheckBox
33-
Margin="0,0,0,10"
34-
Content="IsTestEnabled"
35-
IsChecked="{Binding Path=IsTestEnabled}" />
36-
<Button Command="{Binding Path=Test2Command}" Content="Button with canExecute depend on Checkbox 'IsTestEnabled'" />
37-
</StackPanel>
38-
<StackPanel Margin="10" Orientation="Vertical">
39-
<Button
40-
Command="{Binding Path=Test3Command}"
41-
CommandParameter="Hello"
42-
Content="Button with no canExecute, and have a string as CommandParameter" />
43-
</StackPanel>
44-
</StackPanel>
27+
<atc:UniformSpacingPanel
28+
Margin="40"
29+
Orientation="Vertical"
30+
Spacing="20">
31+
32+
<Button Command="{Binding Path=Test1Command}" Content="Button with no canExecute" />
33+
34+
<CheckBox
35+
Margin="0,0,0,10"
36+
Content="IsTestEnabled"
37+
IsChecked="{Binding Path=IsTestEnabled}" />
38+
<Button Command="{Binding Path=Test2Command}" Content="Button with canExecute depend on Checkbox 'IsTestEnabled'" />
39+
40+
<Button
41+
Command="{Binding Path=Test3Command}"
42+
CommandParameter="Hello"
43+
Content="Button with no canExecute, and have a string as CommandParameter" />
44+
45+
<Button
46+
Command="{Binding Path=Test4Command}"
47+
CommandParameter="Hello word"
48+
Content="Button with canExecute method depend on Checkbox 'IsTestEnabled', and have a string as CommandParameter" />
49+
50+
</atc:UniformSpacingPanel>
4551

4652
</ScrollViewer>
4753
</GroupBox>

sample/Atc.Wpf.Sample/SamplesWpf/Commands/RelayCommandAsyncViewModel.cs

+13
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public class RelayCommandAsyncViewModel : ViewModelBase
1010

1111
public IRelayCommandAsync<string> Test3Command => new RelayCommandAsync<string>(Test3CommandHandler);
1212

13+
public IRelayCommandAsync<string> Test4Command => new RelayCommandAsync<string>(Test4CommandHandler, CanTest4CommandHandler);
14+
1315
public bool IsTestEnabled
1416
{
1517
get => isTestEnabled;
@@ -37,4 +39,15 @@ private async Task Test3CommandHandler(string obj)
3739
await Task.Delay(1000, CancellationToken.None).ConfigureAwait(false);
3840
_ = MessageBox.Show("Test3-command is hit", $"CommandParameter: {obj}", MessageBoxButton.OK);
3941
}
42+
43+
private bool CanTest4CommandHandler(string obj)
44+
{
45+
return IsTestEnabled;
46+
}
47+
48+
private async Task Test4CommandHandler(string obj)
49+
{
50+
await Task.Delay(1000, CancellationToken.None).ConfigureAwait(false);
51+
_ = MessageBox.Show("Test4-command is hit", $"CommandParameter: {obj}", MessageBoxButton.OK);
52+
}
4053
}

sample/Atc.Wpf.Sample/SamplesWpf/Commands/RelayCommandView.xaml

+24-18
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,30 @@
2424
<GroupBox Header="Usage">
2525
<ScrollViewer>
2626

27-
<StackPanel Margin="10" Orientation="Vertical">
28-
<StackPanel Margin="10" Orientation="Vertical">
29-
<Button Command="{Binding Path=Test1Command}" Content="Button with no canExecute" />
30-
</StackPanel>
31-
<StackPanel Margin="10" Orientation="Vertical">
32-
<CheckBox
33-
Margin="0,0,0,10"
34-
Content="IsTestEnabled"
35-
IsChecked="{Binding Path=IsTestEnabled}" />
36-
<Button Command="{Binding Path=Test2Command}" Content="Button with canExecute depend on Checkbox 'IsTestEnabled'" />
37-
</StackPanel>
38-
<StackPanel Margin="10" Orientation="Vertical">
39-
<Button
40-
Command="{Binding Path=Test3Command}"
41-
CommandParameter="Hello"
42-
Content="Button with no canExecute, and have a string as CommandParameter" />
43-
</StackPanel>
44-
</StackPanel>
27+
<atc:UniformSpacingPanel
28+
Margin="40"
29+
Orientation="Vertical"
30+
Spacing="20">
31+
32+
<Button Command="{Binding Path=Test1Command}" Content="Button with no canExecute" />
33+
34+
<CheckBox
35+
Margin="0,0,0,10"
36+
Content="IsTestEnabled"
37+
IsChecked="{Binding Path=IsTestEnabled}" />
38+
<Button Command="{Binding Path=Test2Command}" Content="Button with canExecute depend on Checkbox 'IsTestEnabled'" />
39+
40+
<Button
41+
Command="{Binding Path=Test3Command}"
42+
CommandParameter="Hello"
43+
Content="Button with no canExecute, and have a string as CommandParameter" />
44+
45+
<Button
46+
Command="{Binding Path=Test4Command}"
47+
CommandParameter="Hello word"
48+
Content="Button with canExecute method depend on Checkbox 'IsTestEnabled', and have a string as CommandParameter" />
49+
50+
</atc:UniformSpacingPanel>
4551

4652
</ScrollViewer>
4753
</GroupBox>

sample/Atc.Wpf.Sample/SamplesWpf/Commands/RelayCommandViewModel.cs

+12
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public class RelayCommandViewModel : ViewModelBase
1010

1111
public IRelayCommand<string> Test3Command => new RelayCommand<string>(Test3CommandHandler);
1212

13+
public IRelayCommand<string> Test4Command => new RelayCommand<string>(Test4CommandHandler, CanTest4CommandHandler);
14+
1315
public bool IsTestEnabled
1416
{
1517
get => isTestEnabled;
@@ -34,4 +36,14 @@ private void Test3CommandHandler(string obj)
3436
{
3537
_ = MessageBox.Show("Test3-command is hit", $"CommandParameter: {obj}", MessageBoxButton.OK);
3638
}
39+
40+
private bool CanTest4CommandHandler(string obj)
41+
{
42+
return IsTestEnabled;
43+
}
44+
45+
private void Test4CommandHandler(string obj)
46+
{
47+
_ = MessageBox.Show("Test4-command is hit", $"CommandParameter: {obj}", MessageBoxButton.OK);
48+
}
3749
}

0 commit comments

Comments
 (0)