spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

Can any 1 suggest me, How to pass values between xaml.cs to class1.cs page?


As sugested in comments you can share data by several options:

Option 1: Using Data Binding
http://msdn.microsoft.com/en-us/library/ms752347(v=vs.110).aspx

Option 2: Define property in your ViewModel class to pass it. Add some method to handle get player request in your view-model. For example:

  public class MainViewModel
  {
     public string TeamID { get; set; }

     public MainViewModel()
     {
        Players = new
ObservableCollection<PlayersViewModel>();
     }

     public void GetPlayer()
     {
        string url =
"http://192.168.1.19/projects/t20lite/index.php/api/api/get_playersbyteam;"
        // Do something with url and tour TeamID
        var task = new
HttpGetTask<PlayerList>(url,
this.OnPostExecute);
        task.OnPreExecute = this.OnPreExecute;
        task.OnError = this.OnError;

        task.Execute();
     }   
  }  

And you need to create your ViewModel once. So I suggest you to create your ViewModel in constructor of your View instead of button-click handler.

  public class MainView
  {
     public MainView()
     {
        InitializeComponent();
        this.ViewModel = new MainViewModel();
     }

     public MainViewModel ViewModel
     {
        get { return this.DataContext as
MainViewModel; }
        set { this.DataContext = value; }
     }

     private void TeadIdText_TextChanged(object
sender, TextChangedEventArgs e)
     {
         this.ViewModel.TeamID = TeamIdtxt.Text;  
     
     }

     private void Btn_Ok_Click(object sender,
RoutedEventArgs e)
     {         
         this.ViewModel.GetPlayer();   
     }         
  }

Categories : C#

Related to : Can any 1 suggest me, How to pass values between xaml.cs to class1.cs page?
How to extract result from org.elasticsearch.search.suggest.Suggest object on scala
I got the working solution from this link - https://groups.google.com/forum/#!topic/elasticsearch/FwRv0D5qIi8 The solution is - import org.elasticsearch.node.NodeBuilder._ import org.elasticsearch.search.suggest.completion.CompletionSuggestionBuilder import org.elasticsearch.search.suggest.completion.CompletionSuggestion // Build query for searching the client. var suggeste

Categories : Scala
Changing the value of a textfied in JFrame class1, JFrame class2,... by selecting an item from jtable in Jframe class3
As @AndrewThompson wisely mentioned, the use of multiple JFrame is a bad practice. In this case a (non-)modal dialog would be a better choice. Now let's assume you choose non-modal dialogs, then you still having the same problem. There are several ways to solve it but essentially you need to keep a reference to the frame/dialog which opened the calendar's frame. Even better, you can use interface

Categories : Java
Which way would you suggest to return default value that is not null?
Split the method into two cases: string TryGetImageName() { if (GetImageNameFunc != null) { string imageName = GetImageNameFunc(); if (!string.IsNullOrEmpty(imageName)) { return imageName; } } return null; //no default! } string GetImageNameOrDefault() { return TryGetImageName() ?? "default.png"; } Your method was doing two things at

Categories : C#
I am not getting placeholder in kendo dropdownlist.Can any one suggest me for solution
There is no "placeholder" property of kendo drop-down widget. Instead you can do that by placing an "optionLabel" property.i.e. var data1 = [ //this part is related to the above html tag {text: "org1", value: "1", color: "#a8a9aa", selected:true }, {text: "org2", value: "2", color: "#000", selected: false }, {text: "org3", value: "3", color: "#0

Categories : Kendo Ui
Add result to Search Field for Auto Suggest
You could use the html5-feature datalist: http://www.w3schools.com/tags/tag_datalist.asp <input list="browsers"> <datalist id="browsers"> <option value="Internet Explorer"> <option value="Firefox"> <option value="Chrome"> <option value="Opera"> <option value="Safari"> </datalist> To link it with your own autocomplete-data, create the da

Categories : Javascript
Recently Add
Process MainWindowTitle not displaying for all running processes
SendGrid Tutorial resulting in Bad Request
Dropdown list from table in ASP NET MVC
Newtonsoft.JSON Serialization Array, Object, or Null
Using LINQ to select a byte array
How to stop scripting?
C# access to object property after json decode
How to kill instance of Word/Excel File in C#
Datatypes for MemoryStream.Capacity vs MemoryStream.Length
How to remove a selected row from a table when using KnockoutJS
SqlCommand returns null even tho there is data in the database
Replacing words in a body of text from array
C# dropping milliseconds from Java SOAP call
C# Deserialize list in JSON
Deserialize xml by linq, default with many elements
How to Access Grid View from hub section Data Template Windows phone 8.1 in C#
Input dialogue popup on mouse click
WPF: Binding to MainWindow Property SOLVED
Why is setting a field many times slower than getting a field?
Change multiple materials in one GameObject in Unity3D
.NET MVC error client side with custom validation attribute
Windows Search Service - text saved in ansi (codepage 1251) format - search for non-english symbols gives no result
String.Split - Omit empty array elements OR below a certain length
RequiredFieldValidator does not validate when ValidationGroup applied
Which WCF's extension point should be used for setting context for each operation?
Determine var type depending on ternary (?) Operator on int array
Resolving Windows phone 8.1 Compilation Error: GetENumerator
Specific Ordering of a List of Objects using LINQ
'string' does not contain a definition for 'Fill' and no extension method 'Fill' accepting a first argument of type 'string' could be found
how can ı pass data from serverside to clientside
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.