Inheritance: INotifyPropertyChanged
コード例 #1
0
 public RecentAccountViewModel(ViewModelBase parent, Account account, string accountName, Amount balance)
     : base(parent)
 {
     Account = account;
     AccountName = accountName;
     Balance = balance;
 }
コード例 #2
0
        public RecentAccountViewModel(ViewModelBase parent, Account account, AccountProperties properties)
            : base(parent)
        {
            if (parent == null)
                throw new ArgumentNullException(nameof(parent));
            if (properties == null)
                throw new ArgumentNullException(nameof(properties));

            Account = account;
            AccountName = properties.AccountName;
            Balance = properties.TotalBalance;
        }
コード例 #3
0
ファイル: ViewModelBase.cs プロジェクト: tuxcanfly/Paymetheus
 /// <summary>
 /// Optionally handles a specific message posted by a child view model.
 /// </summary>
 /// <param name="message">Child message to handle.</param>
 /// <returns>Returns true if the message was handled and should not be propigated to a parent view model.</returns>
 protected virtual bool OnRoutedMessage(ViewModelBase sender, ViewModelMessage message)
 {
     return false;
 }
コード例 #4
0
ファイル: ViewModelBase.cs プロジェクト: tuxcanfly/Paymetheus
 public ViewModelBase(ViewModelBase parent = null)
 {
     _parentViewModel = parent;
 }
コード例 #5
0
ファイル: ShellViewModel.cs プロジェクト: btcsuite/Paymetheus
        protected override bool OnRoutedMessage(ViewModelBase sender, ViewModelMessageBase message)
        {
            var showTx = message as ShowTransactionMessage;
            if (showTx != null)
            {
                ShowTransaction(showTx.Transaction);
                return true;
            }

            var showAccount = message as ShowAccountMessage;
            if (showAccount != null)
            {
                ShowAccount(showAccount.Account);
                return true;
            }

            var openDialog = message as OpenDialogMessage;
            if (openDialog != null && sender == VisibleContent)
            {
                VisibleDialogContent = openDialog.Dialog;
                return true;
            }

            var hideDialog = message as HideDialogMessage;
            if (hideDialog != null && sender == VisibleDialogContent)
            {
                VisibleDialogContent = null;
                return true;
            }

            return false;
        }