-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding SearchBox to Gallery #662
Conversation
@@ -51,6 +71,20 @@ public void Forward() | |||
public MainWindowViewModel(INavigationService navigationService) | |||
{ | |||
_controls = ControlsInfoDataSource.Instance.ControlsInfo; | |||
|
|||
_allPages = new ObservableCollection<ControlInfoDataItem>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just access the GetAllPages() function from ControlsInfoDataSource for this.
@@ -111,6 +115,39 @@ public ICollection<ControlInfoDataItem> GetAllControlsInfo() | |||
return allControls; | |||
} | |||
|
|||
private void GetAllPages() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private void GetAllPages() | |
public ICollection<ControlInfoDataItem> GetAllPages() |
@@ -70,6 +72,8 @@ private ControlsInfoDataSource() | |||
{ | |||
var jsonText = ReadControlsData(); | |||
ControlsInfo = JsonSerializer.Deserialize<List<ControlInfoDataItem>>(jsonText); | |||
|
|||
GetAllPages(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetAllPages(); | |
_allPages = GetAllPages(); |
} | ||
} | ||
|
||
public ObservableCollection<ControlInfoDataItem> FilterItems(string filterText) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not return ICollection<ControlInfoDataItem>
from here ?
Closing as long standing. |
Fixes: #633
The following implementation adds search box functionality to search/filter out controls in gallery application
Microsoft Reviewers: Open in CodeFlow