void AvatarView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { var user = e.NewValue as GPUser; if (user == null) { return; } _ViewModel = user; }
public void Sync(WCFGameUser serverUser) { if (Game != null) { if (Game.ClientGameUser == this && serverUser.NeedReConnect) { MainWindow.ClientInfo.ClientGameId = Game.WCFGame.Id; } } if (WCFGameUser.Login != serverUser.Login) { WCFGameUser.Login = serverUser.Login; GPUser = MainWindow.GamePortal.GetUser(WCFGameUser.Login); base.OnPropertyChanged("GPUser"); } WCFGameUser.NewChat = serverUser.NewChat; WCFGameUser.NewStep = serverUser.NewStep; }
public ExtGameUser(ExtGame game, WCFGameUser wcfGameUser) { Game = game; WCFGameUser = wcfGameUser; if (wcfGameUser.Login == "Вестерос") { GPUser = MainWindow.GamePortal.Vesteros; } else if (!string.IsNullOrEmpty(wcfGameUser.Login)) { GPUser = MainWindow.GamePortal.GetUser(wcfGameUser.Login); } if (!string.IsNullOrEmpty(WCFGameUser.HomeType)) { ExtHomeType = MainWindow.ClientInfo.WorldData.HomeType.Single(p => p.WCFHomeType.Name == WCFGameUser.HomeType); } Sync(wcfGameUser); }
private void UserProfile_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { _User = (GPUser)e.NewValue; }
public Awards(GPUser user) { VisibilityAllHouseVictory = user.ProgressViewModels.All(p => p.Value.VictoryCount != 0) ? Visibility.Visible : Visibility.Collapsed; Values = new Dictionary <string, double> { { "AwardsCount", VisibilityAllHouseVictory == Visibility.Visible ? 1 : 0 } }; foreach (KeyValuePair <string, AwardItem> item in MaxValues) { Values.Add(item.Key, 0); } PassingList = new Dictionary <string, AwardItem>(); foreach (KeyValuePair <string, ProgressViewModel> item in user.ProgressViewModels) { if (item.Value.VictoryCount > 0) { string key = $"MaxTotalVictory*{item.Key}"; //if (Values.ContainsKey(key)) //{ Values["AwardsCount"]++; SetValue(key, item.Value.VictoryCount); //} //else //{ //} } } SetValue("dynamic_MaxTotalVictory1", user.ProgressViewModels.Sum(p => p.Value.VictoryCount)); foreach (KeyValuePair <string, ProgressViewModel> item in user.ProgressViewModels) { if (item.Value.Efficiency > 0 && item.Value.VictoryCount > 2) { string key = $"MaxEfficiency*{item.Key}"; //if (Values.ContainsKey(key)) SetValue(key, item.Value.Efficiency); //else //{ //} } } var SerLorasCount = user.EndedUserGames.Where(p => p.HonorPosition < 5).Count(); if (SerLorasCount > 0) { Values["AwardsCount"]++; SerLoras = new AwardItem() { Name = App.GetResources($"awardsType_SerLoras"), Image = "/Image/Awards/SerLoras.png", Value = SerLorasCount }; SetValue("awardsType_SerLorasMax", SerLorasCount); } ////особые медали только рыцарям и выше //if (user.AllPower >= 300) //{ //} }
public LikeProfileViewModel(GPUser user) { User = user; Password = string.Empty; }
void PersonView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { user = (GPUser)e.NewValue; }