Example #1
0
 public UserControl_Coop(Group_Model group, HomePage_ViewModel homePageViewModel)
 {
     InitializeComponent();
     this.GroupName.Text = "Joindre le groupe: <" + group.createGroup.name + ">" + " SVP";
     DataContext         = new Coop_ViewModel(this, homePageViewModel, group);
     //DataContext = new TemplateView_ViewModel<UserControl_Coop>(this, homePageViewModel, group);
 }
 public UserProfil_ViewModel(HomePage_ViewModel vm)
 {
     HomeVm        = vm;
     this.File     = GlobalUser.Avatar;
     UpdateProfil  = new GeneralCommands <object>(Update_Profil, CanUpdate_Profil);
     ChoosePicture = new GeneralCommands <object>(ChoosePic, CanChoose);
 }
 public UserControl_Solo(Group_Model group, HomePage_ViewModel homePageViewModel)
 {
     InitializeComponent();
     this.GroupName.Text = "Veuillez joindre le groupe: <" + group.createGroup.name + ">";
     DataContext         = new Solo_ViewModel(this, homePageViewModel, group);
     //DataContext = new TemplateView_ViewModel<UserControl_Solo>(this, homePageViewModel, group);
 }
        public Home_Page()
        {
            NavigationPage.SetHasNavigationBar(this, false);
            InitializeComponent();
            var datastore = new DataStores();

            BindingContext = new HomePage_ViewModel(Navigation, datastore);
        }
Example #5
0
        public UserControl_Write(StateUpdate_Model stateUpdate, HomePage_ViewModel homePageViewModel)
        {
            InitializeComponent();
            gameInfoBar = new UserControl_GameInfoBar(stateUpdate, homePageViewModel);
            this.InfoBar.Children.Add(gameInfoBar);

            this.DrawingArea.Children.Add(drawView);
        }
 public UserControl_HomePage(MainWindow window, User user)
 {
     InitializeComponent();
     this.user = user;
     this.button.IsHitTestVisible = false;
     this.home    = new HomePage_ViewModel(this);
     DataContext  = this.home;
     this._window = window;
 }
 public ChatWindow(HomePage_ViewModel home, UserControl_ChatControl chat)
 {
     InitializeComponent();
     this._home   = home;
     this._myChat = chat;
     this._home._homePageView.MyChat.Children.Remove(chat);
     this.MyChatWindow.Children.Add(chat);
     this.Show();
 }
Example #8
0
        public UserControl_Passive(StateUpdate_Model stateUpdate, HomePage_ViewModel homePageViewModel)
        {
            this.activatetuto = false;


            this.BarInfoPassive = new UserControl_GameInfoBar(stateUpdate, homePageViewModel);
            InitializeComponent();
            this.virtualP = new VirtualPlayer(this.PassiveCanvas, this.PassiveCanvasPath);
            this.InfoBar.Children.Add(this.BarInfoPassive);
        }
        public GameDifficulties_ViewModel(GameDifficultiesWindow gameDiffWindow, HomePage_ViewModel homePageViewModel)
        {
            this._gameDiffWindow    = gameDiffWindow;
            this._homePageViewModel = homePageViewModel;

            CloseWindowCommand = new GeneralCommands <object>(CloseWindow, CanCloseWindow);
            _onClosingWindow   = new RelayCommand <CancelEventArgs>(OnClosing_Window);

            ChooseLevelCommand = new GeneralCommands <object>(ChooseLevel, CanChooseLevel);
        }
        public UserControl_Guess(StateUpdate_Model stateUpdate, HomePage_ViewModel homePageViewModel)
        {
            thirdGess         = false;
            this.activateTuto = false;
            InitializeComponent();

            DataContext          = new Guess_ViewModel(this);
            this.PassivViewGuess = new UserControl_Passive(stateUpdate, homePageViewModel);
            this.PassiveView.Children.Add(this.PassivViewGuess);
            //if (stateUpdate.attemptLeft == 0)
            //    this.GuessButton.IsEnabled = false;
        }
Example #11
0
        public Solo_ViewModel(UserControl_Solo soloView, HomePage_ViewModel homePageViewModel, Group_Model group)
        {
            this._soloView          = soloView;
            this._homePageViewModel = homePageViewModel;
            this._group             = group;
            this._basicMode         = new BasicMode(homePageViewModel, group);

            ReturnToGroupsList = new GeneralCommands <object>(this._basicMode.RetunToGroups_List, this._basicMode.CanRetunToGroups_List);
            ReadyToStart       = new GeneralCommands <object>(this._basicMode.ReadyTo_Start, this._basicMode.CanBeReadyTo_Start);
            AddPlayerCommand   = new GeneralCommands <object>(this._basicMode.AddPlayer, this._basicMode.CanAddPlayer);

            this._basicMode.EmitGroup();
            this.ListenListGroups();
        }
        public UserControl_GameInfoBar(StateUpdate_Model stateUpdate, HomePage_ViewModel homePageViewModel)
        {
            InitializeComponent();

            if (stateUpdate.answer != null)
            {
                this.Answer.Content = "Réponse: " + stateUpdate.answer;
            }
            else
            {
                if (stateUpdate.attemptsLeft >= 0)
                {
                    this.Answer.Content = "Tentatives : " + stateUpdate.attemptsLeft;
                }
                else
                {
                    this.Answer.Content = "Tentative: infini";
                }
            }

            this.MyPoints.Content = "Mon équipe: " + stateUpdate.points;

            if (stateUpdate.otherPoints >= 0)
            {
                this.OtherPoints.Content = "Autre équipe: " + stateUpdate.otherPoints;
            }

            this.Round.Content = "Manche: " + stateUpdate.currentRound;

            switch (stateUpdate.role)
            {
            case "WRITE":
                this.Role.Content = "Auteur";
                break;

            case "GUESS":
                this.Role.Content = "Devineur";
                break;

            case "PASSIVE":
                this.Role.Content    = "Passive";
                this.Bar1.Background = (Brush) new BrushConverter().ConvertFrom("#FF2EC3B6");
                this.Bar2.Background = (Brush) new BrushConverter().ConvertFrom("#FF2EC3B6");
                break;
            }

            this.Countdown(stateUpdate.startTimer / 1000, TimeSpan.FromSeconds(1), cur => this.Timer.Content = cur.ToString());
        }
        public UserControl_GamesRoom(HomePage_ViewModel homePageViewModel)
        {
            InitializeComponent();

            switch (GlobalUser.Difficulty)
            {
            case "EASY": this.GameLevel.Text = "DIFFICULTÉ : FACILE"; break;

            case "INTERMEDIATE": this.GameLevel.Text = "DIFFICULTÉ :INTERMÉDIAIRE"; break;

            case "DIFFICULT": this.GameLevel.Text = "DIFFICULTÉ :DIFFICILE"; break;
            }

            if (GlobalUser.Mode == "CLASSIC")
            {
                this.GameMode.Text = "MODE: CLASSIQUE";
            }
            else
            {
                this.GameMode.Text = "MODE: " + GlobalUser.Mode;
            }

            DataContext = new GamesRoom_ViewModel(this, homePageViewModel);
        }
Example #14
0
 public UserControl_Group(HomePage_ViewModel homePageViewModel, Group_Model group)
 {
     InitializeComponent();
     this.GroupName.Content = "Le nom du groupe: " + group.createGroup.name;
     DataContext            = new Group_ViewModel(homePageViewModel, group);
 }
Example #15
0
 public UpdateUserProfilWindow(HomePage_ViewModel vm)
 {
     InitializeComponent();
     DataContext = new UserProfil_ViewModel(vm);
 }
Example #16
0
 public GameDifficultiesWindow(HomePage_ViewModel homePageViewModel)
 {
     InitializeComponent();
     DataContext = new GameDifficulties_ViewModel(this, homePageViewModel);
 }
 public BasicMode(HomePage_ViewModel homePageViewModel, Group_Model group)
 {
     this._homePageViewModel = homePageViewModel;
     this._group             = group;
 }
Example #18
0
 public UserControl_GameMode(HomePage_ViewModel homePageViewModel)
 {
     InitializeComponent();
     DataContext = new GameMode_ViewModel(homePageViewModel);
 }
 public UserControl_Classic(Group_Model group, HomePage_ViewModel homePageViewModel)
 {
     InitializeComponent();
     this.GroupName.Text = "Veuillez choisir une place dans le groupe: <" + group.createGroup.name + ">";
     DataContext         = new Classic_ViewModel(this, homePageViewModel, group);
 }
Example #20
0
 public UserControl_Tournament(Group_Model group, HomePage_ViewModel homePageViewModel)
 {
     InitializeComponent();
     DataContext          = new Tournament_ViewModel(this, homePageViewModel, group);
     this.GroupTitle.Text = "Veuillez joindre le tournoi : <" + group.createGroup.name + ">";
 }