Skip to content
This repository was archived by the owner on Apr 23, 2023. It is now read-only.

Commit c4e6081

Browse files
cleanup
1 parent 22ac5f2 commit c4e6081

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

Windows/DataBindingSamples/DataBindingSamples/MainPage.xaml.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,16 @@
22
using DataBindingSamples.Services;
33
using System.Collections.Generic;
44
using System.Linq;
5-
using Windows.UI.Xaml;
65
using Windows.UI.Xaml.Controls;
76

87
namespace DataBindingSamples
98
{
109
public sealed partial class MainPage : Page
1110
{
1211
private BooksService _booksService = new BooksService();
13-
public MainPage()
14-
{
15-
this.InitializeComponent();
16-
}
12+
public MainPage() => InitializeComponent();
1713

18-
public void OnRefreshBooks()
19-
{
20-
_booksService.RefreshBooks();
21-
}
14+
public void OnRefreshBooks() => _booksService.RefreshBooks();
2215

2316
public void OnAddBook() =>
2417
_booksService.AddBook(new Book(GetNextBookId(), $"Professional C# {GetNextBookId() + 3}", "Wrox Press"));

Windows/DataBindingSamples/DataBindingSamples/Views/BookUserControl.xaml.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@ namespace DataBindingSamples.Views
66
{
77
public sealed partial class BookUserControl : UserControl
88
{
9-
public BookUserControl()
10-
{
11-
this.InitializeComponent();
12-
}
9+
public BookUserControl() => InitializeComponent();
1310

1411
public Book Book
1512
{
16-
get { return (Book)GetValue(BookProperty); }
17-
set { SetValue(BookProperty, value); }
13+
get => (Book)GetValue(BookProperty);
14+
set => SetValue(BookProperty, value);
1815
}
1916

2017
public static readonly DependencyProperty BookProperty =
2118
DependencyProperty.Register("Book", typeof(Book), typeof(BookUserControl), new PropertyMetadata(null));
22-
2319
}
2420
}

0 commit comments

Comments
 (0)