public async Task <string> UpdateItem(SingleTaskModel model)
        {
            var userInfo = await _local.GetItemAsync <UserModel>("user");

            var _token = userInfo.AccessToken;

            var request = new HttpRequestMessage(HttpMethod.Put, _baseURL);

            request.Headers.Authorization = new AuthenticationHeaderValue("bearer", _token);
            var content = JsonConvert.SerializeObject(model);

            request.Content = new StringContent(content, Encoding.UTF8, "application/json");
            var client = _client.CreateClient();

            HttpResponseMessage response = await client.SendAsync(request);

            return(response.ReasonPhrase);
        }
Example #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            TaskPriority priority = (TaskPriority)value;

            return(SingleTaskModel.PriorityDescription(priority));
        }
Example #3
0
 public SingleTaskViewModel(string description, DateTime creationDate, DateTime realizationDate, TaskPriority priority, bool isAccomplished)
 {
     singleTaskModel = new SingleTaskModel(description, creationDate, realizationDate, priority, isAccomplished);
 }
Example #4
0
 public SingleTaskViewModel(SingleTaskModel task)
 {
     singleTaskModel = task;
 }