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