1+ using System ;
2+ using System . ComponentModel ;
3+ using Prism . Regions ;
4+
5+ namespace Prism . Avalonia . Tests . Mocks
6+ {
7+ class MockPresentationRegion : IRegion
8+ {
9+ public MockViewsCollection MockViews = new MockViewsCollection ( ) ;
10+ public MockViewsCollection MockActiveViews = new MockViewsCollection ( ) ;
11+
12+ public MockPresentationRegion ( )
13+ {
14+ Behaviors = new MockRegionBehaviorCollection ( ) ;
15+ }
16+ public IRegionManager Add ( object view )
17+ {
18+ MockViews . Items . Add ( view ) ;
19+
20+ return null ;
21+ }
22+
23+ public void Remove ( object view )
24+ {
25+ MockViews . Items . Remove ( view ) ;
26+ MockActiveViews . Items . Remove ( view ) ;
27+ }
28+
29+ public void Activate ( object view )
30+ {
31+ MockActiveViews . Items . Add ( view ) ;
32+ }
33+
34+ public IRegionManager Add ( object view , string viewName )
35+ {
36+ throw new NotImplementedException ( ) ;
37+ }
38+
39+ public IRegionManager Add ( object view , string viewName , bool createRegionManagerScope )
40+ {
41+ throw new NotImplementedException ( ) ;
42+ }
43+
44+ public object GetView ( string viewName )
45+ {
46+ throw new NotImplementedException ( ) ;
47+ }
48+
49+ public IRegionManager RegionManager { get ; set ; }
50+
51+ public IRegionBehaviorCollection Behaviors { get ; set ; }
52+
53+ public IViewsCollection Views
54+ {
55+ get { return MockViews ; }
56+ }
57+
58+ public IViewsCollection ActiveViews
59+ {
60+ get { return MockActiveViews ; }
61+ }
62+
63+ public void Deactivate ( object view )
64+ {
65+ MockActiveViews . Items . Remove ( view ) ;
66+ }
67+
68+ private object context ;
69+ public object Context
70+ {
71+ get { return context ; }
72+ set
73+ {
74+ context = value ;
75+ OnPropertyChange ( "Context" ) ;
76+ }
77+ }
78+
79+ public NavigationParameters NavigationParameters
80+ {
81+ get { throw new System . NotImplementedException ( ) ; }
82+ set { throw new System . NotImplementedException ( ) ; }
83+ }
84+
85+ private string name ;
86+ public string Name
87+ {
88+ get { return this . name ; }
89+ set
90+ {
91+ this . name = value ;
92+ this . OnPropertyChange ( "Name" ) ;
93+ }
94+ }
95+
96+ public event PropertyChangedEventHandler PropertyChanged ;
97+
98+ public void OnPropertyChange ( string propertyName )
99+ {
100+ if ( PropertyChanged != null )
101+ {
102+ PropertyChanged ( this , new PropertyChangedEventArgs ( propertyName ) ) ;
103+ }
104+ }
105+
106+ public bool Navigate ( Uri source )
107+ {
108+ throw new NotImplementedException ( ) ;
109+ }
110+
111+ public void RequestNavigate ( Uri target , Action < NavigationResult > navigationCallback )
112+ {
113+ throw new NotImplementedException ( ) ;
114+ }
115+
116+ public void RequestNavigate ( Uri target , Action < NavigationResult > navigationCallback , NavigationParameters navigationParameters )
117+ {
118+ throw new NotImplementedException ( ) ;
119+ }
120+
121+ public void RemoveAll ( )
122+ {
123+ throw new NotImplementedException ( ) ;
124+ }
125+
126+ public IRegionNavigationService NavigationService
127+ {
128+ get { throw new NotImplementedException ( ) ; }
129+ set { throw new System . NotImplementedException ( ) ; }
130+ }
131+
132+
133+ public Comparison < object > SortComparison
134+ {
135+ get
136+ {
137+ throw new NotImplementedException ( ) ;
138+ }
139+ set
140+ {
141+ throw new NotImplementedException ( ) ;
142+ }
143+ }
144+ }
145+ }
0 commit comments