Example #1
0
 private void DoReset()
 {
     ChartValues = null;
     Chart       = null;
     VotedUsers  = null;
     IsStarted   = false;
     _handler?.StopListining();
     _handler = null;
 }
Example #2
0
        private void CloseStartWindow(Views.ChildWindows.Voting.Start start, bool fromDatacontext = false)
        {
            var dataContext = Internal.ChildWindow.GetDatacontext
                              <ViewModels.ChildWindows.Voting.Start>(start.DataContext);

            if (dataContext?.IsCompleted() == true && fromDatacontext)
            {
                _handler = new Extensions.Voting.Handler(dataContext.Properties);
                _handler.StartListining();
                ChartValues = new Models.ChartValues();
                CreateChart(dataContext.Properties);
                VotedUsers            = new ObservableCollection <VotedUser>();
                _handler.OnUserVoted += OnUserVoted;
                IsStarted             = true;
                start.Close();
            }
            else
            {
                IsStarted = false;
            }
        }