public BankAccountListView()
 {
     InitializeComponent();
     Loaded += (s, ea) =>
     {
         _viewModel           = DataContext as BankAccountListViewModel;
         _viewModel.Deleting += OnDeleting;
         _viewModel.Deleted  += OnDeleted;
         _viewModel.Failed   += OnFailed;
         _viewModel.Error    += OnError;
     };
     Unloaded += (s, ea) =>
     {
         _viewModel.Deleting -= OnDeleting;
         _viewModel.Deleted  -= OnDeleted;
         _viewModel.Failed   -= OnFailed;
         _viewModel.Error    -= OnError;
     };
 }
Exemple #2
0
        public AddEditBankAccountWindow()
        {
            CultureInfo culutreInfo = new CultureInfo("fa-IR");

            culutreInfo.DateTimeFormat.ShortDatePattern          = "yyyy/MM/dd";
            System.Threading.Thread.CurrentThread.CurrentCulture = culutreInfo;
            //برای نمایش اعداد به صورت فارسی
            // Thread.CurrentThread.CurrentCulture = new CultureInfo("fa-IR");
            Thread.CurrentThread.CurrentUICulture = culutreInfo;
            InitializeComponent();
            // BankAccount = new BankAccount();
            //  DataContext = addEditBankAccountWindowViewModel;
            //    this.AccDocumentItemsRadGridView.KeyboardCommandProvider = new CustomKeyboardCommandProvider(this.AccDocumentItemsRadGridView);

            Loaded += (s, e) =>
            {
                //  addEditBankAccountWindowViewModel = DataContext as AddEditBankAccountWindowViewModel;
                _viewModel = DataContext as BankAccountListViewModel;
                //addEditBankAccountWindowViewModel.LoadBanks();
            };
        }