Clean up
This commit is contained in:
		
							parent
							
								
									cdfe85bdaf
								
							
						
					
					
						commit
						33acdcf9dc
					
				| @ -1,11 +1,7 @@ | ||||
| using System; | ||||
| 
 | ||||
| namespace eShopOnContainers.Core.ViewModels | ||||
| namespace eShopOnContainers.Core.ViewModels | ||||
| { | ||||
|     using System.Threading.Tasks; | ||||
|     using System.Windows.Input; | ||||
|     using eShopOnContainers.Core.Helpers; | ||||
|     using Xamarin.Forms; | ||||
|     using Helpers; | ||||
|     using Models.Marketing; | ||||
|     using Services.Marketing; | ||||
|     using Base; | ||||
| @ -14,8 +10,6 @@ namespace eShopOnContainers.Core.ViewModels | ||||
|     { | ||||
|         private CampaignItem _campaign; | ||||
|         private readonly ICampaignService _campaignService; | ||||
|         private string _campaignAvailability; | ||||
| 
 | ||||
| 
 | ||||
|         public CampaignDetailsViewModel(ICampaignService campaignService) | ||||
|         { | ||||
| @ -32,57 +26,6 @@ namespace eShopOnContainers.Core.ViewModels | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         public string Name | ||||
|         { | ||||
|             get =>  _campaign.Name; | ||||
|             set | ||||
|             { | ||||
|                 _campaign.Name = value; | ||||
|                 RaisePropertyChanged(() => Name); | ||||
|             } | ||||
|         }  | ||||
| 
 | ||||
|         public string Description | ||||
|         { | ||||
|             get => _campaign.Description; | ||||
|             set | ||||
|             { | ||||
|                 _campaign.Description = value; | ||||
|                 RaisePropertyChanged(() => Description); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         public string PictureUri | ||||
|         { | ||||
|             get => _campaign.PictureUri; | ||||
|             set | ||||
|             { | ||||
|                 _campaign.PictureUri = value; | ||||
|                 RaisePropertyChanged(() => PictureUri); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         public string From | ||||
|         { | ||||
|             get => _campaign.From.ToString("MMMM dd, yyyy"); | ||||
|         } | ||||
| 
 | ||||
|         public string To | ||||
|         { | ||||
|             get => _campaign.To.ToString("MMMM dd, yyyy"); | ||||
|         } | ||||
| 
 | ||||
|         //public string CampaignAvailability | ||||
|         //{ | ||||
|         //    get => $"{_campaign.From:MMMM dd, yyyy} until {_campaign.To:MMMM dd, yyyy}"; | ||||
|         //    set | ||||
|         //    { | ||||
|         //        _campaignAvailability = value; | ||||
|         //        RaisePropertyChanged(() => CampaignAvailability); | ||||
|         //    } | ||||
|         //} | ||||
| 
 | ||||
| 
 | ||||
|         public override async Task InitializeAsync(object navigationData) | ||||
|         { | ||||
|             if (navigationData is int) | ||||
|  | ||||
| @ -1,17 +1,13 @@ | ||||
| using System.Runtime.CompilerServices; | ||||
| using System.Threading.Tasks; | ||||
| using System.Windows.Input; | ||||
| using eShopOnContainers.Core.Helpers; | ||||
| using eShopOnContainers.Core.Models.Catalog; | ||||
| using eShopOnContainers.Core.Models.User; | ||||
| using Xamarin.Forms; | ||||
| 
 | ||||
| namespace eShopOnContainers.Core.ViewModels | ||||
| namespace eShopOnContainers.Core.ViewModels | ||||
| { | ||||
|     using System.Threading.Tasks; | ||||
|     using System.Windows.Input; | ||||
|     using Xamarin.Forms; | ||||
|     using System.Collections.ObjectModel; | ||||
|     using Models.Marketing; | ||||
|     using Services.Marketing; | ||||
|     using Base; | ||||
|     using Helpers; | ||||
| 
 | ||||
|     public class CampaignViewModel : ViewModelBase | ||||
|     { | ||||
|  | ||||
| @ -3,9 +3,6 @@ | ||||
|              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||||
|              x:Class="eShopOnContainers.Core.Views.CampaignDetailsView" | ||||
| 			 xmlns:viewModelBase="clr-namespace:eShopOnContainers.Core.ViewModels.Base;assembly=eShopOnContainers.Core" | ||||
|              xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core" | ||||
|              xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core" | ||||
|              xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core" | ||||
|              viewModelBase:ViewModelLocator.AutoWireViewModel="true" | ||||
|              Title="Campaign Details"> | ||||
|     <ContentPage.Resources> | ||||
| @ -17,7 +14,7 @@ | ||||
|                 <Setter Property="Margin" | ||||
|                         Value="0" /> | ||||
|             </Style> | ||||
|             <Style x:Key="SettingsTitleStyle"  | ||||
|             <Style x:Key="CampaignTitleStyle"  | ||||
|                    TargetType="{x:Type Label}"> | ||||
|                 <Setter Property="FontFamily" | ||||
|                         Value="{StaticResource MontserratRegular}" /> | ||||
| @ -31,9 +28,9 @@ | ||||
|                         Value="12, 0" /> | ||||
|             </Style> | ||||
| 
 | ||||
|             <Style x:Key="SettingsDescriptionStyle"  | ||||
|             <Style x:Key="CampaignDescriptionStyle"  | ||||
|                    TargetType="{x:Type Label}" | ||||
|                    BasedOn="{StaticResource SettingsTitleStyle}"> | ||||
|                    BasedOn="{StaticResource CampaignTitleStyle}"> | ||||
|                 <Setter Property="FontSize"  | ||||
|                         Value="{StaticResource LittleSize}" /> | ||||
|             </Style> | ||||
| @ -70,8 +67,6 @@ | ||||
|                         Grid.Column="0"                        | ||||
|                         Grid.Row="1"> | ||||
|                         <Image | ||||
|                             Grid.Column="0" | ||||
|                             Grid.Row="0" | ||||
|                             Source="{Binding Campaign.PictureUri, Converter={StaticResource ImageConverter}}"         | ||||
|                             Aspect="AspectFit" | ||||
|                             VerticalOptions="Start" | ||||
| @ -79,21 +74,19 @@ | ||||
|                         <Label  | ||||
|                             Text="{Binding Campaign.Name}" | ||||
|                             TextColor="{StaticResource GreenColor}" | ||||
|                             Style="{StaticResource SettingsTitleStyle}"/> | ||||
|                             Style="{StaticResource CampaignTitleStyle}"/> | ||||
|                         <Label | ||||
|                             Text="{Binding Campaign.Description}" | ||||
|                             Style="{StaticResource SettingsDescriptionStyle}"/> | ||||
|                         <StackLayout  | ||||
|                             Style ="{StaticResource CampaignStyle}"                     | ||||
|                             Grid.Row="2" | ||||
|                             Style="{StaticResource CampaignDescriptionStyle}"/> | ||||
|                         <StackLayout                 | ||||
|                             HorizontalOptions="Center" | ||||
|                             Margin="12,0,0,0" > | ||||
|                             <Label | ||||
|                             Text="{Binding Campaign.From, StringFormat='From {0:MMMM dd, yyyy}'}" | ||||
|                             Style="{StaticResource SettingsDescriptionStyle}"/> | ||||
|                             Style="{StaticResource CampaignDescriptionStyle}"/> | ||||
|                             <Label | ||||
|                             Text="{Binding Campaign.To, StringFormat='until {0:MMMM dd, yyyy}'}" | ||||
|                             Style="{StaticResource SettingsDescriptionStyle}"/> | ||||
|                             Style="{StaticResource CampaignDescriptionStyle}"/> | ||||
|                         </StackLayout> | ||||
|                     </StackLayout> | ||||
|                 </Grid> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user