private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     if (CurrentWeigth == null)
     {
         CurrentWeigth = new Weight(1000);
     }
     grid1.DataContext = CurrentWeigth;
 }
 /// <summary>
 /// Create a new Weight object.
 /// </summary>
 /// <param name="code">Initial value of the Code property.</param>
 /// <param name="quantity">Initial value of the Quantity property.</param>
 public static Weight CreateWeight(global::System.Int32 code, global::System.Double quantity)
 {
     Weight weight = new Weight();
     weight.Code = code;
     weight.Quantity = quantity;
     return weight;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Weights EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToWeights(Weight weight)
 {
     base.AddObject("Weights", weight);
 }
 public WeightDetail(Weight data)
     : this()
 {
     CurrentWeigth = data;
 }