Ejemplo n.º 1
0
        public void Add(CommentVM voter, VoteCandidateVM candidate)
        {
            if (!_dataMap.ContainsKey(voter.AuthorID))
            {
                Dictionary <CommentVM, VoteCandidateVM> first = new Dictionary <CommentVM, VoteCandidateVM>();

                _dataMap.Add(voter.AuthorID, first);
            }

            _dataMap[voter.AuthorID].Add(voter, candidate);
        }
Ejemplo n.º 2
0
        private bool On_Candidate_CommandAction(string cmdKey, VoteCandidateVM sender)
        {
            switch (cmdKey)
            {
            case VoteCandidateVM.CmdKey_OpenVoterColle:
                NameListWindow wnd = new NameListWindow(sender.VoterColle);
                wnd.ShowDialog();
                break;

            default:
                break;
            }
            return(true);
        }
Ejemplo n.º 3
0
        private void On_TXT_Name_Drop(object sender, DragEventArgs e)
        {
            _vm = this.DataContext as VoteCandidateVM;
            if (_vm == null)
            {
                return;
            }

            String[] dropFiles = (String[])e.Data.GetData(DataFormats.FileDrop);
            String   filePath  = dropFiles[0];

            try
            {
                _vm.ImageObject = LoadImage(filePath);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(String.Format("Set image source fail:{0}", ex.Message));
                _vm.ImageObject = null;
            }
        }
Ejemplo n.º 4
0
 private void On_Loaded(object sender, RoutedEventArgs e)
 {
     _vm = this.DataContext as VoteCandidateVM;
     _vm.CommandAction = On_Candidate_CommandAction;
 }