public FlagSelectorWindow(JryFlagType type, IEnumerable<string> readySelected = null) : this() { this.TitleTextBlock.Text = String.Format( Properties.Resources.FlagSelectorWindow_Title_Format, type.GetLocalizeString()); this.DataContext = this.ViewModel = new FlagSelectorViewModel(type, readySelected ?? Enumerable.Empty<string>()); this.EditFlagUserControl.FlagType = type; this.EditFlagUserControl.ViewModel.Creating += this.EditFlagUserControl_ViewModel_Creating; this.EditFlagUserControl.ViewModel.Created += this.ViewModel.EditFlagUserControl_ViewModel_Created; this.ViewModel.LoadAsync(); }
public FlagSelectorWindow(JryFlagType type, IEnumerable<string> readySelected = null) : this() { this.TitleTextBlock.Text = string.Format( Properties.Resources.FlagSelectorWindow_Title_Format, type.GetLocalizeString()); this.DataContext = this.ViewModel = new FlagSelectorViewModel(type); this.EditFlagUserControl.ViewModel.FlagType = type; this.EditFlagUserControl.ViewModel.CreateMode(); this.EditFlagUserControl.ViewModel.Creating += this.EditFlagUserControl_ViewModel_Creating; this.EditFlagUserControl.ViewModel.Created += this.ViewModel.EditFlagUserControl_ViewModel_Created; if (readySelected != null) { this.ViewModel.SelectedStrings.AddRange(readySelected); } #pragma warning disable 4014 this.ViewModel.LoadAsync(); #pragma warning restore 4014 }