12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System.Windows.Controls;
- using Prism.Commands;
- using WpfAppUI.View;
- namespace WpfAppUI.ViewModel
- {
- internal class MainWindowViewModel
- {
- #region Поля
- private Frame frame;
- private DelegateCommand _emploeeNavigateCommand;
- private DelegateCommand _clientsNavigateCommand;
- private DelegateCommand _inquiriesNavigateCommand;
- private DelegateCommand _securitiesNavigateCommand;
- private DelegateCommand _transactionsNavigateCommand;
- private DelegateCommand _treatiesNavigateCommand;
- private DelegateCommand _closeFrameCommand;
- #endregion
- #region Реализация
- private void EmploeeNavigateRealization() => frame.Navigate(new Emploee());
- private void ClientsNavigateRealization() => frame.Navigate(new Clients());
- private void InquiriesNavigateRealization() => frame.Navigate(new Inquiries());
- private void SecuritiesNavigateRealization() => frame.Navigate(new Securities());
- private void TransactionsNavigateRealization() => frame.Navigate(new Transactions());
- private void TreatiesNavigateRealization() => frame.Navigate(new Treaties());
- private void CloseFrameRealization() => frame.Navigate(null);
- #endregion
- #region Конструктор
- public MainWindowViewModel(Frame frame)
- {
- this.frame = frame;
- EmploeeNavigateCommand = new DelegateCommand(EmploeeNavigateRealization);
- ClientsNavigateCommand = new DelegateCommand(ClientsNavigateRealization);
- InquiriesNavigateCommand = new DelegateCommand(InquiriesNavigateRealization);
- SecuritiesNavigateCommand = new DelegateCommand(SecuritiesNavigateRealization);
- TransactionsNavigateCommand = new DelegateCommand(TransactionsNavigateRealization);
- TreatiesNavigateCommand = new DelegateCommand(TreatiesNavigateRealization);
- CloseFrameCommand = new DelegateCommand(CloseFrameRealization);
- }
- #endregion
- #region Свойства
- public DelegateCommand EmploeeNavigateCommand { get => _emploeeNavigateCommand; set => _emploeeNavigateCommand = value; }
- public DelegateCommand ClientsNavigateCommand { get => _clientsNavigateCommand; set => _clientsNavigateCommand = value; }
- public DelegateCommand InquiriesNavigateCommand { get => _inquiriesNavigateCommand; set => _inquiriesNavigateCommand = value; }
- public DelegateCommand SecuritiesNavigateCommand { get => _securitiesNavigateCommand; set => _securitiesNavigateCommand = value; }
- public DelegateCommand TransactionsNavigateCommand { get => _transactionsNavigateCommand; set => _transactionsNavigateCommand = value; }
- public DelegateCommand TreatiesNavigateCommand { get => _treatiesNavigateCommand; set => _treatiesNavigateCommand = value; }
- public DelegateCommand CloseFrameCommand { get => _closeFrameCommand; set => _closeFrameCommand = value; }
- #endregion
- }
- }
|