예제 #1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (!_isInitialized)
            {
                var publishParams = VKParametersRepository.GetParameterForIdAndReset(INPUT_PARAM_ID) as VKPublishInputData;


                _inputData = publishParams;

                InitializeUIFromInputParams();

                UpdateState();

                _isInitialized = true;
            }
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (!_isInitialized)
            {
                var publishParams = VKParametersRepository.GetParameterForIdAndReset(INPUT_PARAM_ID) as VKPublishInputData;


                _inputData = publishParams;

                InitializeUIFromInputParams();

                UpdateState();

                _isInitialized = true;
            }
        }
예제 #3
0
 public void wall_post(string par)
 {
     string[] options = JsonHelper.Deserialize<string[]>(par);
     VKPublishInputData data = new VKPublishInputData();
     try {
         JObject p = JObject.Parse(options[0]);
         var dict = p.ToObject<Dictionary<string, string>>();
         data.Text = dict["message"];
         // TODO links and images
     } catch (Exception e) {
         data.Text = options[0];
     }
     DispatchInvoke(() => {
         VKSDK.Publish(data);
     });
 }
        private void Publish_Click(object sender, RoutedEventArgs e)
        {
            var rs = Application.GetResourceStream(new Uri("TestImage.jpg", UriKind.Relative));        
            Stream imageStream = rs.Stream;

            var inputData = new VKPublishInputData
            {
                Text = "В Доме Зингера",
                Image = imageStream, 
                ExternalLink = new VKPublishInputData.VKLink
                {
                    Title = "VK",
                    Subtitle = "VKontakte",
                    Uri = "http://VK.com"
                }
            };

            VKSDK.Publish(inputData);
        }
예제 #5
0
파일: VKSDK.cs 프로젝트: orinichevd/BVk
        public static void Publish(VKPublishInputData data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            VKParametersRepository.SetParameterForId(VKPublishPage.INPUT_PARAM_ID, data);

            RootFrame.Navigate(new Uri(string.Format("/VK.WindowsPhone.SDK;component/Pages/VKPublishPage.xaml"), UriKind.Relative));
        }