-
Notifications
You must be signed in to change notification settings - Fork 385
Expand file tree
/
Copy pathChangeViewModeSwitcher.axaml.cs
More file actions
41 lines (35 loc) · 1.12 KB
/
ChangeViewModeSwitcher.axaml.cs
File metadata and controls
41 lines (35 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
namespace SourceGit.Views
{
public partial class ChangeViewModeSwitcher : UserControl
{
public static readonly StyledProperty<Models.ChangeViewMode> ViewModeProperty =
AvaloniaProperty.Register<ChangeViewModeSwitcher, Models.ChangeViewMode>(nameof(ViewMode));
public Models.ChangeViewMode ViewMode
{
get => GetValue(ViewModeProperty);
set => SetValue(ViewModeProperty, value);
}
public ChangeViewModeSwitcher()
{
InitializeComponent();
}
private void SwitchToList(object sender, RoutedEventArgs e)
{
ViewMode = Models.ChangeViewMode.List;
e.Handled = true;
}
private void SwitchToGrid(object sender, RoutedEventArgs e)
{
ViewMode = Models.ChangeViewMode.Grid;
e.Handled = true;
}
private void SwitchToTree(object sender, RoutedEventArgs e)
{
ViewMode = Models.ChangeViewMode.Tree;
e.Handled = true;
}
}
}