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

Commit 23e46b2

Browse files
committed
Use View/ViewModel base types
1 parent cb36e9e commit 23e46b2

File tree

7 files changed

+22
-14
lines changed

7 files changed

+22
-14
lines changed

src/GitHub.InlineReviews/GitHub.InlineReviews.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@
202202
<Project>{6AFE2E2D-6DB0-4430-A2EA-F5F5388D2F78}</Project>
203203
<Name>GitHub.Extensions</Name>
204204
</ProjectReference>
205+
<ProjectReference Include="..\GitHub.UI.Reactive\GitHub.UI.Reactive.csproj">
206+
<Project>{158b05e8-fdbc-4d71-b871-c96e28d5adf5}</Project>
207+
<Name>GitHub.UI.Reactive</Name>
208+
</ProjectReference>
205209
<ProjectReference Include="..\GitHub.UI\GitHub.UI.csproj">
206210
<Project>{346384dd-2445-4a28-af22-b45f3957bd89}</Project>
207211
<Name>GitHub.UI</Name>

src/GitHub.InlineReviews/SampleData/CommentTooltipViewModelDesigner.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
using System;
22
using System.Collections.ObjectModel;
3+
using GitHub.ViewModels;
34
using GitHub.InlineReviews.ViewModels;
4-
using GitHub.Models;
5-
using GitHub.SampleData;
6-
using ReactiveUI;
75

86
namespace GitHub.InlineReviews.SampleData
97
{
10-
class CommentTooltipViewModelDesigner : ICommentTooltipViewModel
8+
class CommentTooltipViewModelDesigner : ViewModelBase, ICommentTooltipViewModel
119
{
1210
public ObservableCollection<ICommentViewModel> Comments { get; }
1311
= new ObservableCollection<ICommentViewModel>();

src/GitHub.InlineReviews/SampleData/CommentViewModelDesigner.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
using System;
22
using System.Reactive;
3+
using ReactiveUI;
34
using GitHub.InlineReviews.ViewModels;
45
using GitHub.Models;
56
using GitHub.SampleData;
6-
using ReactiveUI;
7+
using GitHub.ViewModels;
78

89
namespace GitHub.InlineReviews.SampleData
910
{
10-
class CommentViewModelDesigner : ICommentViewModel
11+
class CommentViewModelDesigner : ViewModelBase, ICommentViewModel
1112
{
1213
public CommentViewModelDesigner()
1314
{

src/GitHub.InlineReviews/ViewModels/CommentTooltipViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
using System;
22
using System.Collections.ObjectModel;
3+
using GitHub.ViewModels;
34

45
namespace GitHub.InlineReviews.ViewModels
56
{
67
/// <summary>
78
/// Base view model for a tooltip that displays comments.
89
/// </summary>
9-
public class CommentTooltipViewModel : ICommentTooltipViewModel
10+
public class CommentTooltipViewModel : ViewModelBase, ICommentTooltipViewModel
1011
{
1112
/// <inheritdoc/>
1213
public ObservableCollection<ICommentViewModel> Comments { get; } =

src/GitHub.InlineReviews/ViewModels/ICommentTooltipViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
using System;
22
using System.Collections.ObjectModel;
3-
using GitHub.Models;
43
using ReactiveUI;
4+
using GitHub.Models;
5+
using GitHub.ViewModels;
56

67
namespace GitHub.InlineReviews.ViewModels
78
{
89
/// <summary>
910
/// A comment tooltip.
1011
/// </summary>
11-
public interface ICommentTooltipViewModel
12+
public interface ICommentTooltipViewModel : IViewModel
1213
{
1314
/// <summary>
1415
/// Gets the comments in the thread.

src/GitHub.InlineReviews/Views/CommentTooltipView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<UserControl x:Class="GitHub.InlineReviews.Views.CommentTooltipView"
1+
<local:GenericCommentTooltipView x:Class="GitHub.InlineReviews.Views.CommentTooltipView"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -40,4 +40,4 @@
4040
</ItemsControl>
4141
</ScrollViewer>
4242
</DockPanel>
43-
</UserControl>
43+
</local:GenericCommentTooltipView>

src/GitHub.InlineReviews/Views/CommentTooltipView.xaml.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
using System;
2-
using System.ComponentModel;
3-
using System.Windows.Controls;
2+
using GitHub.UI;
3+
using GitHub.InlineReviews.ViewModels;
44

55
namespace GitHub.InlineReviews.Views
66
{
7-
public partial class CommentTooltipView : UserControl
7+
public class GenericCommentTooltipView : ViewBase<ICommentTooltipViewModel, CommentTooltipView>
8+
{ }
9+
10+
public partial class CommentTooltipView : GenericCommentTooltipView
811
{
912
public CommentTooltipView()
1013
{

0 commit comments

Comments
 (0)