public Home() { bool designTime = System.ComponentModel.DesignerProperties.GetIsInDesignMode(new DependencyObject()); if (designTime == false) { this.disp = App.Current.MainWindow.Dispatcher; this.Contacts = new ObservableCollection <Contact>(); this.LoadedCMD = new RelayCommand(OnLoaded); this.OpenSettingsCMD = new RelayCommand(() => { View.Settings settings = new View.Settings(); settings.Show(); }); this.TalkCMD = new RelayCommand(() => { if (this.SelectedContact != -1) { View.Talk talk = new View.Talk(); ViewModel.Talk talkVM = new Talk(this.Login, this.Contacts[this.SelectedContact], this.netsoul); talk.DataContext = talkVM; talk.Show(); } }); this.Status = new ObservableCollection <string>(); foreach (var st in Enum.GetValues(typeof(ContactStatus))) { this.Status.Add(st.ToString()); } } }
public void OpenSettingsForm() { View.Settings S = new View.Settings(Model.Configuration.Config.GetConfig); S.SaveSettings += new View.SaveSettingsHandler(SaveSettings); S.Show(); }
public void OpenSettingsForm() { View.Settings S = new View.Settings(Model.Configuration.Config.GetConfig); S.SaveSettings += new View.SaveSettingsHandler(SaveSettings); S.Show(); }
private async Task Connect() { if (!string.IsNullOrWhiteSpace(Properties.Settings.Default.Login) && !string.IsNullOrWhiteSpace(Properties.Settings.Default.Password)) { this.netsoul.Login = Properties.Settings.Default.Login; this.netsoul.Password = Properties.Settings.Default.Password; } else { View.Settings settings = new View.Settings(); settings.ShowDialog(); this.netsoul.Login = Properties.Settings.Default.Login; this.netsoul.Password = Properties.Settings.Default.Password; } this.IsLogued = await this.netsoul.ConnectAsync(); this.Login = this.netsoul.Login; }