示例#1
0
        private void climbPath_Click(object sender, RoutedEventArgs e)
        {
            Button btn = (sender as Button);

            System.Windows.Controls.Image img = (btn.Content as Image);
            training l_training = trainingDataGrid.SelectedItem as training;

            if (l_training != null)
            {
                if (DetailsImage == c_grapplesImage)
                {
                    ClimbPathView l_usrPage = new ClimbPathView(l_training, db_context);
                    viewFrame.Content        = l_usrPage;
                    DetailsImage             = c_plotsImage;
                    img.Source               = _plotsBmi;
                    _detailsBtnLable.Content = "Полотна";
                }
                else
                {
                    TrainingView l_usrPage = new TrainingView(l_training, db_context);
                    viewFrame.Content        = l_usrPage;
                    DetailsImage             = c_grapplesImage;
                    img.Source               = _grapplesBmi;
                    _detailsBtnLable.Content = "Зацепы";
                }
            }
        }
示例#2
0
        public TrainingViewModel()
        {
            i_trPath1 = new ObservableCollection <tr_pathWrapper>();
            i_trPath2 = new ObservableCollection <tr_pathWrapper>();
            i_trPath3 = new ObservableCollection <tr_pathWrapper>();
            i_angles  = new ObservableCollection <angle_seriesWrapper>();

            training = new training();
        }
 public ClimbPathModel()
 {
     tracks = new ObservableCollection <Track>();
     tracks.Add(new Track(0));
     tracks.Add(new Track(1));
     tracks.Add(new Track(2));
     training = new training();
     subscribeToggles();
 }
示例#4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            training l_training = trainingDataGrid.SelectedItem as training;

            if (l_training != null)
            {
                PlayTrainingPage l_usrPage = new PlayTrainingPage(l_training, db_context);
                viewFrame.Content = l_usrPage;
            }
        }
 public ClimbPathModel(training a_tr, scalodromEntities3 a_db_context)
 {
     training   = a_tr;
     db_context = a_db_context;
     tracks     = new ObservableCollection <Track>();
     tracks.Add(new Track(0));
     tracks.Add(new Track(1));
     tracks.Add(new Track(2));
     subscribeToggles();
 }
 public ClimbPathView(training a_tr, scalodromEntities3 a_db_context)
 {
     _model    = new ClimbPathModel(a_tr, a_db_context);
     _grapples = new ObservableCollection <grapple_series>((from grapplesList in a_db_context.grapple_series where grapplesList.id_training == a_tr.id select grapplesList));
     InitializeComponent();
     DataContext = _model;
     if (_grapples.Count > 0)
     {
         _model.Grapples = _grapples;
     }
 }
示例#7
0
        private void strobos_Click(object sender, RoutedEventArgs e)
        {
            Button btn = (sender as Button);

            System.Windows.Controls.Image img = (btn.Content as Image);
            training l_training = trainingDataGrid.SelectedItem as training;

            if (l_training != null)
            {
                ClimbPathView l_usrPage = new ClimbPathView(l_training, db_context);
                viewFrame.Content = l_usrPage;
            }
        }
示例#8
0
 public PlayTrainingModel(training a_tr, scalodromEntities3 a_db_context)
 {
     initialModel           = new TrainingViewModel(a_tr, a_db_context);
     CurrentPlayButtonImage = c_playImage;
     IsPlaying      = false;
     CurrentTime    = 0;
     MaxPrgBarValue = CalculatePrgBarLength();
     if (_bw == null)
     {
         _bw = new BackgroundWorker();
         _bw.WorkerSupportsCancellation = true;
         _bw.DoWork += Bw_DoWork;
         _bw.RunWorkerAsync();
     }
 }
示例#9
0
        private void trainingDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            training l_training = trainingDataGrid.SelectedItem as training;

            if (l_training != null)
            {
                if (DetailsImage == c_grapplesImage)
                {
                    TrainingView l_usrPage = new TrainingView(l_training, db_context);
                    viewFrame.Content = l_usrPage;
                }
                else
                {
                    ClimbPathView l_usrPage = new ClimbPathView(l_training, db_context);
                    viewFrame.Content = l_usrPage;
                }
            }
        }
示例#10
0
        public TrainingViewModel(training a_tr, scalodromEntities3 a_db_context)
        {
            training   = a_tr;
            db_context = a_db_context;
            i_trPath1  = collectionOfWrappers((from trPathList in a_db_context.tr_path where trPathList.id_training == training.id && trPathList.num_path == 1 select trPathList).ToList());
            i_trPath2  = collectionOfWrappers((from trPathList in a_db_context.tr_path where trPathList.id_training == training.id && trPathList.num_path == 2 select trPathList).ToList());
            i_trPath3  = collectionOfWrappers((from trPathList in a_db_context.tr_path where trPathList.id_training == training.id && trPathList.num_path == 3 select trPathList).ToList());
            i_angles   = collectionOfAngleWrappers((from angles in a_db_context.angle_series where angles.id_training == training.id select angles).ToList());

            i_seriesCollection1      = ConfigureTrPathPlot(i_trPath1);
            i_seriesCollection2      = ConfigureTrPathPlot(i_trPath2);
            i_seriesCollection3      = ConfigureTrPathPlot(i_trPath3);
            i_seriesCollectionAngles = ConfigureAnglesPlot(i_angles);

            path_graph_dict.Add(1, i_seriesCollection1); path_graph_dict.Add(2, i_seriesCollection2); path_graph_dict.Add(3, i_seriesCollection3);
            path_col_dict.Add(1, i_trPath1); path_col_dict.Add(2, i_trPath2); path_col_dict.Add(3, i_trPath3);

            ConfigureCollbacksTrPath(i_trPath1, i_seriesCollection1, 1);
            ConfigureCollbacksTrPath(i_trPath2, i_seriesCollection2, 2);
            ConfigureCollbacksTrPath(i_trPath3, i_seriesCollection3, 3);
        }
示例#11
0
 public TrainingView(training a_tr, scalodromEntities3 a_db_context)
 {
     InitializeComponent();
     model       = new TrainingViewModel(a_tr, a_db_context);
     DataContext = model;
 }
示例#12
0
 public PlayTrainingPage(training a_tr, scalodromEntities3 a_db_context)
 {
     InitializeComponent();
     model       = new PlayTrainingModel(a_tr, a_db_context);
     DataContext = model;
 }