-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates and fixes for Carousels and registration
- Loading branch information
Showing
26 changed files
with
390 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Windows.Input; | ||
|
||
namespace HelloRegions.ViewModels | ||
{ | ||
public interface IRefreshable | ||
{ | ||
ICommand RefreshCommand { get; } | ||
bool IsRefreshing { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,57 @@ | ||
using Prism.Navigation; | ||
using System; | ||
using System.Threading.Tasks; | ||
using System.Windows.Input; | ||
using Prism.Commands; | ||
using Prism.Navigation; | ||
using Prism.Regions.Navigation; | ||
|
||
namespace HelloRegions.ViewModels | ||
{ | ||
public class RegionAViewModel : ViewModelBase | ||
public class RegionAViewModel : ViewModelBase, IRefreshable | ||
{ | ||
public RegionAViewModel(INavigationService navigationService, IRegionNavigationService regionNavigation) | ||
: base(regionNavigation) | ||
public RegionAViewModel(INavigationService navigationService) | ||
{ | ||
Title = "Hello from Region A"; | ||
NavigationService = navigationService; | ||
RegionNavigation = regionNavigation; | ||
|
||
RefreshCommand = new DelegateCommand(OnRefresh); | ||
} | ||
|
||
private string _refreshedMessage; | ||
public string RefreshedMessage | ||
{ | ||
get => _refreshedMessage; | ||
set => SetProperty(ref _refreshedMessage, value); | ||
} | ||
|
||
public INavigationService NavigationService { get; set; } | ||
|
||
public IRegionNavigationService RegionNavigation { get; set; } | ||
public ICommand RefreshCommand { get; } | ||
|
||
private bool _isRefreshing; | ||
public bool IsRefreshing | ||
{ | ||
get => _isRefreshing; | ||
set => SetProperty(ref _isRefreshing, value); | ||
} | ||
|
||
private async void OnRefresh() | ||
{ | ||
IsRefreshing = true; | ||
|
||
try | ||
{ | ||
await Task.Delay(TimeSpan.FromSeconds(3)); | ||
RefreshedMessage = $"Last Refreshed: {DateTime.Now:T}"; | ||
} | ||
catch (System.Exception) | ||
{ | ||
// You should catch exceptions and handle them here... | ||
} | ||
finally | ||
{ | ||
IsRefreshing = false; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
e2e/Forms/src/HelloRegions/ViewModels/ScrollViewDemoRegionViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Prism.Regions; | ||
|
||
namespace HelloRegions.ViewModels | ||
{ | ||
public class ScrollViewDemoRegionViewModel : RegionDemoBase | ||
{ | ||
public ScrollViewDemoRegionViewModel(IRegionManager regionManager) | ||
: base(regionManager) | ||
{ | ||
} | ||
|
||
protected override string RegionName => "ScrollRegion"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.