Skip to content

Commit b9e991c

Browse files
authored
File scope all the namespaces (#3286)
1 parent aeee113 commit b9e991c

File tree

280 files changed

+34509
-34789
lines changed

Some content is hidden

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

280 files changed

+34509
-34789
lines changed
Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,41 @@
1-
namespace MahMaterialDragablzMashUp
1+
namespace MahMaterialDragablzMashUp;
2+
3+
/// <summary>
4+
/// No WPF project is complete without it's own version of this.
5+
/// </summary>
6+
public class AnotherCommandImplementation : ICommand
27
{
3-
/// <summary>
4-
/// No WPF project is complete without it's own version of this.
5-
/// </summary>
6-
public class AnotherCommandImplementation : ICommand
7-
{
8-
private readonly Action<object?> _execute;
9-
private readonly Func<object?, bool> _canExecute;
8+
private readonly Action<object?> _execute;
9+
private readonly Func<object?, bool> _canExecute;
1010

11-
public AnotherCommandImplementation(Action<object?> execute)
12-
: this(execute, null)
13-
{
14-
}
11+
public AnotherCommandImplementation(Action<object?> execute)
12+
: this(execute, null)
13+
{
14+
}
1515

16-
public AnotherCommandImplementation(Action<object?> execute, Func<object?, bool>? canExecute)
17-
{
18-
if (execute is null) throw new ArgumentNullException(nameof(execute));
16+
public AnotherCommandImplementation(Action<object?> execute, Func<object?, bool>? canExecute)
17+
{
18+
if (execute is null) throw new ArgumentNullException(nameof(execute));
1919

20-
_execute = execute;
21-
_canExecute = canExecute ?? (x => true);
22-
}
20+
_execute = execute;
21+
_canExecute = canExecute ?? (x => true);
22+
}
2323

24-
public bool CanExecute(object? parameter) => _canExecute(parameter);
24+
public bool CanExecute(object? parameter) => _canExecute(parameter);
2525

26-
public void Execute(object? parameter) => _execute(parameter);
26+
public void Execute(object? parameter) => _execute(parameter);
2727

28-
public event EventHandler? CanExecuteChanged
28+
public event EventHandler? CanExecuteChanged
29+
{
30+
add
2931
{
30-
add
31-
{
32-
CommandManager.RequerySuggested += value;
33-
}
34-
remove
35-
{
36-
CommandManager.RequerySuggested -= value;
37-
}
32+
CommandManager.RequerySuggested += value;
33+
}
34+
remove
35+
{
36+
CommandManager.RequerySuggested -= value;
3837
}
39-
40-
public void Refresh() => CommandManager.InvalidateRequerySuggested();
4138
}
39+
40+
public void Refresh() => CommandManager.InvalidateRequerySuggested();
4241
}

MahMaterialDragablzMashUp/App.xaml.cs

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,29 @@
22
using MaterialDesignThemes.Wpf;
33
using ShowMeTheXAML;
44

5-
namespace MahMaterialDragablzMashUp
5+
namespace MahMaterialDragablzMashUp;
6+
7+
/// <summary>
8+
/// Interaction logic for App.xaml
9+
/// </summary>
10+
public partial class App : Application
611
{
7-
/// <summary>
8-
/// Interaction logic for App.xaml
9-
/// </summary>
10-
public partial class App : Application
12+
protected override void OnStartup(StartupEventArgs e)
1113
{
12-
protected override void OnStartup(StartupEventArgs e)
13-
{
14-
XamlDisplay.Init();
15-
base.OnStartup(e);
16-
17-
//Add/Update brush used by Dragablz when the theme changes
18-
//Solution for https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/issues/2349
19-
PaletteHelper helper = new PaletteHelper();
20-
if (helper.GetThemeManager() is { } themeManager)
21-
{
22-
themeManager.ThemeChanged += ThemeManager_ThemeChanged;
23-
}
24-
}
14+
XamlDisplay.Init();
15+
base.OnStartup(e);
2516

26-
private void ThemeManager_ThemeChanged(object? sender, ThemeChangedEventArgs e)
17+
//Add/Update brush used by Dragablz when the theme changes
18+
//Solution for https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/issues/2349
19+
PaletteHelper helper = new PaletteHelper();
20+
if (helper.GetThemeManager() is { } themeManager)
2721
{
28-
Resources["SecondaryAccentBrush"] = new SolidColorBrush(e.NewTheme.SecondaryMid.Color);
22+
themeManager.ThemeChanged += ThemeManager_ThemeChanged;
2923
}
3024
}
25+
26+
private void ThemeManager_ThemeChanged(object? sender, ThemeChangedEventArgs e)
27+
{
28+
Resources["SecondaryAccentBrush"] = new SolidColorBrush(e.NewTheme.SecondaryMid.Color);
29+
}
3130
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
namespace MahMaterialDragablzMashUp
1+
namespace MahMaterialDragablzMashUp;
2+
3+
/// <summary>
4+
/// Interaction logic for Dialogs.xaml
5+
/// </summary>
6+
public partial class Dialogs : UserControl
27
{
3-
/// <summary>
4-
/// Interaction logic for Dialogs.xaml
5-
/// </summary>
6-
public partial class Dialogs : UserControl
8+
public Dialogs()
79
{
8-
public Dialogs()
9-
{
10-
InitializeComponent();
11-
}
10+
InitializeComponent();
1211
}
1312
}
Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,54 @@
11
using MahApps.Metro.Controls;
22
using MahApps.Metro.Controls.Dialogs;
33

4-
namespace MahMaterialDragablzMashUp
4+
namespace MahMaterialDragablzMashUp;
5+
6+
public class DialogsViewModel
57
{
6-
public class DialogsViewModel
7-
{
8-
public ICommand ShowInputDialogCommand { get; }
8+
public ICommand ShowInputDialogCommand { get; }
99

10-
public ICommand ShowProgressDialogCommand { get; }
10+
public ICommand ShowProgressDialogCommand { get; }
1111

12-
public ICommand ShowLeftFlyoutCommand { get; }
12+
public ICommand ShowLeftFlyoutCommand { get; }
1313

14-
private ResourceDictionary DialogDictionary = new ResourceDictionary() { Source = new Uri("pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Dialogs.xaml") };
14+
private ResourceDictionary DialogDictionary = new ResourceDictionary() { Source = new Uri("pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Dialogs.xaml") };
1515

16-
public DialogsViewModel()
17-
{
18-
ShowInputDialogCommand = new AnotherCommandImplementation(_ => InputDialog());
19-
ShowProgressDialogCommand = new AnotherCommandImplementation(_ => ProgressDialog());
20-
ShowLeftFlyoutCommand = new AnotherCommandImplementation(_ => ShowLeftFlyout());
21-
}
16+
public DialogsViewModel()
17+
{
18+
ShowInputDialogCommand = new AnotherCommandImplementation(_ => InputDialog());
19+
ShowProgressDialogCommand = new AnotherCommandImplementation(_ => ProgressDialog());
20+
ShowLeftFlyoutCommand = new AnotherCommandImplementation(_ => ShowLeftFlyout());
21+
}
2222

23-
public Flyout? LeftFlyout { get; set; }
23+
public Flyout? LeftFlyout { get; set; }
2424

25-
private void InputDialog()
25+
private void InputDialog()
26+
{
27+
var metroDialogSettings = new MetroDialogSettings
2628
{
27-
var metroDialogSettings = new MetroDialogSettings
28-
{
29-
CustomResourceDictionary = DialogDictionary,
30-
NegativeButtonText = "CANCEL"
31-
};
29+
CustomResourceDictionary = DialogDictionary,
30+
NegativeButtonText = "CANCEL"
31+
};
3232

33-
DialogCoordinator.Instance.ShowInputAsync(this, "MahApps Dialog", "Using Material Design Themes", metroDialogSettings);
34-
}
33+
DialogCoordinator.Instance.ShowInputAsync(this, "MahApps Dialog", "Using Material Design Themes", metroDialogSettings);
34+
}
3535

36-
private async void ProgressDialog()
37-
{
38-
var metroDialogSettings = new MetroDialogSettings
39-
{
40-
CustomResourceDictionary = DialogDictionary,
41-
NegativeButtonText = "CANCEL"
42-
};
43-
44-
var controller = await DialogCoordinator.Instance.ShowProgressAsync(this, "MahApps Dialog", "Using Material Design Themes (WORK IN PROGRESS)", true, metroDialogSettings);
45-
controller.SetIndeterminate();
46-
await Task.Delay(3000);
47-
await controller.CloseAsync();
48-
}
49-
50-
private void ShowLeftFlyout()
36+
private async void ProgressDialog()
37+
{
38+
var metroDialogSettings = new MetroDialogSettings
5139
{
52-
((MainWindow)Application.Current.MainWindow).LeftFlyout.IsOpen = !((MainWindow)Application.Current.MainWindow).LeftFlyout.IsOpen;
53-
}
40+
CustomResourceDictionary = DialogDictionary,
41+
NegativeButtonText = "CANCEL"
42+
};
43+
44+
var controller = await DialogCoordinator.Instance.ShowProgressAsync(this, "MahApps Dialog", "Using Material Design Themes (WORK IN PROGRESS)", true, metroDialogSettings);
45+
controller.SetIndeterminate();
46+
await Task.Delay(3000);
47+
await controller.CloseAsync();
48+
}
49+
50+
private void ShowLeftFlyout()
51+
{
52+
((MainWindow)Application.Current.MainWindow).LeftFlyout.IsOpen = !((MainWindow)Application.Current.MainWindow).LeftFlyout.IsOpen;
5453
}
5554
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
namespace MahMaterialDragablzMashUp
1+
namespace MahMaterialDragablzMashUp;
2+
3+
/// <summary>
4+
/// Interaction logic for FlyoutContent.xaml
5+
/// </summary>
6+
public partial class FlyoutContent : UserControl
27
{
3-
/// <summary>
4-
/// Interaction logic for FlyoutContent.xaml
5-
/// </summary>
6-
public partial class FlyoutContent : UserControl
8+
public FlyoutContent()
79
{
8-
public FlyoutContent()
9-
{
10-
InitializeComponent();
11-
}
10+
InitializeComponent();
1211
}
1312
}

MahMaterialDragablzMashUp/Mah.xaml.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
namespace MahMaterialDragablzMashUp
1+
namespace MahMaterialDragablzMashUp;
2+
3+
/// <summary>
4+
/// Interaction logic for MahApps.xaml
5+
/// </summary>
6+
public partial class Mah : UserControl
27
{
3-
/// <summary>
4-
/// Interaction logic for MahApps.xaml
5-
/// </summary>
6-
public partial class Mah : UserControl
8+
public Mah()
79
{
8-
public Mah()
9-
{
10-
InitializeComponent();
11-
}
10+
InitializeComponent();
1211
}
1312
}

0 commit comments

Comments
 (0)