public ChangeEndAddServis(Model.Servis servis) { InitializeComponent(); contoller = new Model.ServisesContoller(servis); Service = contoller.ServiceOne; Service.MainImagePath = s + Service.MainImagePath; gr.DataContext = Service; }
private void Save_Click(object sender, RoutedEventArgs e) { if (Service == null) { Service = gr.DataContext as DB.Service; contoller = new Model.ServisesContoller(Service); } else { Service = gr.DataContext as DB.Service; Service.MainImagePath = Service.MainImagePath.Substring(s.Length); contoller.ServiceOne = Service; contoller.Save(); } this.DialogResult = true; this.Close(); }