Какой ярлык в Visual Studio позволяет переключаться с кода на код Xaml?

Очень хорошее решение с чистым javascript здесь

/*create an XMLHttpRequest object*/

let GethttpRequest=function(){  
  let httpRequest=false;
  if(window.XMLHttpRequest){
    httpRequest   =new XMLHttpRequest();
    if(httpRequest.overrideMimeType){
    httpRequest.overrideMimeType('text/xml');
    }
  }else if(window.ActiveXObject){
    try{httpRequest   =new ActiveXObject("Msxml2.XMLHTTP");
  }catch(e){
      try{
        httpRequest   =new ActiveXObject("Microsoft.XMLHTTP");
      }catch(e){}
    }
  }
  if(!httpRequest){return 0;}
  return httpRequest;
}

  /*Defining a function to make the request every time when it is needed*/

  function MakeRequest(){

    let uriPost       ="myURL";
    let xhrPost       =GethttpRequest();
    let fdPost        =new FormData();
    let date          =new Date();

    /*data to be sent on server*/
    let data          = { 
                        "name"      :"name",
                        "lName"     :"lName",
                        "phone"     :"phone",
                        "key"       :"key",
                        "password"  :"date"
                      };

    let JSONdata =JSON.stringify(data);             
    fdPost.append("data",JSONdata);
    xhrPost.open("POST" ,uriPost, true);
    xhrPost.timeout = 9000;/*the time you need to quit the request if it is not completed*/
    xhrPost.onloadstart = function (){
      /*do something*/
    };
    xhrPost.onload      = function (){
      /*do something*/
    };
    xhrPost.onloadend   = function (){
      /*do something*/
    }
    xhrPost.onprogress  =function(){
      /*do something*/
    }

    xhrPost.onreadystatechange =function(){

      if(xhrPost.readyState < 4){

      }else if(xhrPost.readyState === 4){

        if(xhrPost.status === 200){

          /*request succesfull*/

        }else if(xhrPost.status !==200){

          /*request failled*/

        }

      }


   }
  xhrPost.ontimeout = function (e){
    /*you can stop the request*/
  }
  xhrPost.onerror = function (){
    /*you can try again the request*/
  };
  xhrPost.onabort = function (){
    /*you can try again the request*/
  };
  xhrPost.overrideMimeType("text/plain; charset=x-user-defined-binary");
  xhrPost.setRequestHeader("Content-disposition", "form-data");
  xhrPost.setRequestHeader("X-Requested-With","xmlhttprequest");
  xhrPost.send(fdPost);
}

/*PHP side
<?php
  //check if the variable $_POST["data"] exists isset() && !empty()
  $data        =$_POST["data"];
  $decodedData =json_decode($_POST["data"]);
  //show a single item from the form
  echo $decodedData->name;

?>
*/

/*Usage*/
MakeRequest();
30
задан Nicolas Dorier 12 May 2009 в 12:03
поделиться

4 ответа

In VS2008, while in code-behind of your XAML page (.xaml.cs), pressing SHIFT-F7 will take you to the XAML Designer or the XAML code page, depending on which one had the latest focus. Pressing SHIFT-F7 again will take you from the XAML code page to the designer and vice versa.

While in the XAML designer or XAML code page, pressing F7 takes you to the related code behind page.

UPDATE. Applicable for later versions (e.g. MS VS 2015 too).

24
ответ дан 28 November 2019 в 00:14
поделиться

For VS 2008:

F7 goes from XAML to Code Behind, Shift-F7 goes from Code Behind to XAML

1
ответ дан 28 November 2019 в 00:14
поделиться

Загрузить dpack для визуализации studio (бесплатно) - тогда F7 всегда будет переключаться на "другой" вид. Там же множество других замечательных функций.

0
ответ дан 28 November 2019 в 00:14
поделиться

Когда я впервые установил VS2010, мои раскладки клавиатуры были установлены на (По умолчанию). По умолчанию View.ViewDesigner был сопоставлен с Shift-F7 (представление исходного кода редактора HTML). Чтобы ярлык работал во всех представлениях, мне пришлось изменить сопоставление на «Shift-F7 (Global)». Также сработало изменение раскладки клавиатуры на «Visual C # 2005».

4
ответ дан 28 November 2019 в 00:14
поделиться