123456789101112131415161718192021222324252627282930313233 |
- using System;
- using System.Collections.Generic;
- using ReactiveUI;
- using Acosta.Models;
- using Acosta.Views;
- using Avalonia.Controls;
- namespace Acosta.ViewModels
- {
- public class AddTradeNetworksViewViewModel : ReactiveObject
- {
- SuharevaContext myConnection;
- TradeNetwork currentTrade;
- private UserControl uct = new AddTradeNetworksView();
- public UserControl UCT { get => uct; set => this.RaiseAndSetIfChanged(ref uct, value); }
- public AddTradeNetworksViewViewModel(SuharevaContext myConnection)
- {
- this.myConnection = myConnection;
- CurrentTrade = new TradeNetwork();
- myConnection.Add(CurrentTrade);
- }
- public TradeNetwork CurrentTrade { get => currentTrade; set => currentTrade = value; }
- public void SaveNetwork()
- {
- myConnection.SaveChanges();
- UCT = new TradeNetworksView();
- }
- }
- }
|