private async Task SaveAction()
{
string validName = await ServiceLocator.ContextService.ConvertToValidFileName(LookName);
List<string> nameList = new List<string>();
foreach (var lookItem in _receivedSelectedSprite.Looks)
{
nameList.Add(lookItem.Name);
}
_lookName = await ServiceLocator.ContextService.FindUniqueName(validName, nameList);
var message = new GenericMessage<PortableImage>(Image);
Messenger.Default.Send(message, ViewModelMessagingToken.LookImageToSaveListener);
ServiceLocator.DispatcherService.RunOnMainThread(() =>
{
ServiceLocator.NavigationService.RemoveBackEntry();
ServiceLocator.NavigationService.NavigateBack(this.GetType());
});
//ServiceLocator.DispatcherService.RunOnMainThread(() =>
// ServiceLocator.NavigationService.NavigateTo<LookSavingViewModel>());
var newDimention = new ImageDimension
{
Height = SelectedSize.NewHeight,
Width = SelectedSize.NewWidth
};
var look = await LookHelper.Save(Image, LookName, newDimention, CurrentProgram.BasePath);
ServiceLocator.DispatcherService.RunOnMainThread(() =>
{
_receivedSelectedSprite.Looks.Add(look);
//ServiceLocator.NavigationService.RemoveBackEntryForPlatform(NavigationPlatform.WindowsPhone);
//ServiceLocator.NavigationService.RemoveBackEntryForPlatform(NavigationPlatform.WindowsPhone);
ResetViewModel();
//ServiceLocator.NavigationService.NavigateBack(
// new List<NavigationPlatform>{NavigationPlatform.WindowsStore});
});
}