public async Task <VkDocumentAttachment> Save(string file, string title = null, string tags = null) { var parameters = new Dictionary <string, string>(); parameters.Add("file", file); if (!string.IsNullOrEmpty(title)) { parameters.Add("title", title); } if (!string.IsNullOrEmpty(tags)) { parameters.Add("tags", tags); } _vk.SignMethod(parameters); var response = await VkRequest.GetAsync(VkConst.MethodBase + "docs.save", parameters); if (response["response"] != null) { return(VkDocumentAttachment.FromJson(response["response"].First)); } return(null); }
public MessageDocumentControl(VkDocumentAttachment document) { this.Document = document; this.InitializeComponent(); if (!string.IsNullOrEmpty(document.Photo130)) { ContentControl.ContentTemplate = (DataTemplate)Resources["ImageDocumentTemplate"]; } else { ContentControl.ContentTemplate = (DataTemplate)Resources["GenericDocumentTemplate"]; } }