public void RefreshWindowControls() { // Add controls to Dictionary for easier navigation. _controls.Clear(); var panel = new StackPanel { Name = "MainInfoPanel" }; var idBox = new TextBox { Name = "IdBox", Text = _bossId.ToString(), Margin = new Thickness(10), IsEnabled = false }; var nameBox = new ComboBox { Name = "NameBox", ItemsSource = GameAssets.Bosses.Select(x => x.Name), Margin = new Thickness(10) }; nameBox.SelectedValue = GameAssets.Bosses.FirstOrDefault(x => x.Id == _bossId)?.Name; nameBox.SelectionChanged += NameBox_SelectionChanged; // Set TextBox and ComboBox hints. HintAssist.SetHint(idBox, "ID"); HintAssist.SetHint(nameBox, "Name"); _controls.Add(idBox.Name, idBox); _controls.Add(nameBox.Name, nameBox); foreach (var elem in _controls) { // Set style of each control to MaterialDesignFloatingHint, and set floating hint scale. if (elem.Value is TextBox textBox) { textBox.Style = (Style)FindResource("MaterialDesignOutlinedTextBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); textBox.GotFocus += TextBox_GotFocus; } else if (elem.Value is ComboBox comboBox) { comboBox.Style = (Style)FindResource("MaterialDesignOutlinedComboBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); } panel.Children.Add(elem.Value); } MainGrid.Children.Add(panel); }
public void RefreshStaticValuesPanel() { if (_currentPanel != null) { _currentPanel.Children.Clear(); MainGrid.Children.Remove(_currentPanel); } var panel = new StackPanel { Name = "StaticInfoPanel" }; var selectedMonster = _dataContext; var idBox = new TextBox { Name = "IdBox", Text = selectedMonster.Id.ToString(), Margin = new Thickness(10), IsEnabled = false }; var nameBox = new TextBox { Name = "NameBox", Text = selectedMonster.Name, Margin = new Thickness(10) }; var healthBox = new TextBox { Name = "HealthBox", Text = selectedMonster.Health.ToString(), Margin = new Thickness(10) }; var imageBox = new TextBox { Name = "ImageBox", Text = selectedMonster.Image, Margin = new Thickness(10) }; var descriptionBox = new TextBox { Name = "DescriptionBox", TextWrapping = TextWrapping.Wrap, VerticalAlignment = VerticalAlignment.Stretch, MinWidth = 280, AcceptsReturn = true, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, Height = 160, Text = selectedMonster.Description, Margin = new Thickness(10) }; // Set TextBox and ComboBox hints. HintAssist.SetHint(idBox, "ID"); HintAssist.SetHint(nameBox, "Name"); HintAssist.SetHint(healthBox, "Health"); HintAssist.SetHint(imageBox, "Image"); HintAssist.SetHint(descriptionBox, "Description"); // Add controls to Dictionary for easier navigation. _controls.Clear(); _controls.Add(idBox.Name, idBox); _controls.Add(nameBox.Name, nameBox); _controls.Add(healthBox.Name, healthBox); _controls.Add(imageBox.Name, imageBox); _controls.Add(descriptionBox.Name, descriptionBox); foreach (var elem in _controls) { // Set style of each control to MaterialDesignFloatingHint, and set floating hint scale. if (elem.Value is TextBox textBox) { textBox.Style = (Style)FindResource("MaterialDesignOutlinedTextBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); textBox.GotFocus += TextBox_GotFocus; } else if (elem.Value is ComboBox comboBox) { comboBox.Style = (Style)FindResource("MaterialDesignOutlinedComboBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); } panel.Children.Add(elem.Value); } Grid.SetColumn(panel, 1); _currentPanel = panel; MainGrid.Children.Add(panel); }
public void RefreshStaticValuesPanel() { if (_currentPanel != null) { _currentPanel.Children.Clear(); MainGrid.Children.Remove(_currentPanel); } var panel = new StackPanel { Name = "StaticInfoPanel" }; var selectedRecipe = _dataContext; var idBox = new TextBox { Name = "IdBox", Text = selectedRecipe.Id.ToString(), Margin = new Thickness(10), IsEnabled = false }; var nameBox = new TextBox { Name = "NameBox", Text = selectedRecipe.Name, Margin = new Thickness(10), IsEnabled = false }; var valueBox = new TextBox { Name = "ValueBox", Text = selectedRecipe.Value.ToString(), Margin = new Thickness(10) }; var rarityBox = new ComboBox { Name = "RarityBox", ItemsSource = Enum.GetValues(typeof(Rarity)), SelectedIndex = (int)selectedRecipe.Rarity, Margin = new Thickness(10) }; var artifactIdBox = new TextBox { Name = "ArtifactIDBox", Text = selectedRecipe.ArtifactId.ToString(), Margin = new Thickness(10), IsEnabled = false }; var artifactNameBox = new ComboBox { Name = "ArtifactNameBox", ItemsSource = GameAssets.Artifacts.Select(x => x.Name), Margin = new Thickness(10) }; artifactNameBox.SelectedValue = GameAssets.Artifacts.FirstOrDefault(x => x.Id == selectedRecipe.ArtifactId)?.Name; nameBox.Text = GameAssets.Artifacts.FirstOrDefault(x => x.Id == selectedRecipe.ArtifactId)?.Name; artifactNameBox.SelectionChanged += ArtifactNameBox_SelectionChanged; // Set TextBox and ComboBox hints. HintAssist.SetHint(idBox, "ID"); HintAssist.SetHint(nameBox, "Name"); HintAssist.SetHint(valueBox, "Value"); HintAssist.SetHint(rarityBox, "Rarity"); HintAssist.SetHint(artifactIdBox, "ArtifactID"); HintAssist.SetHint(artifactNameBox, "ArtifactName"); // Add controls to Dictionary for easier navigation. _controls.Clear(); _controls.Add(idBox.Name, idBox); _controls.Add(nameBox.Name, nameBox); _controls.Add(valueBox.Name, valueBox); _controls.Add(rarityBox.Name, rarityBox); _controls.Add(artifactIdBox.Name, artifactIdBox); _controls.Add(artifactNameBox.Name, artifactNameBox); foreach (var elem in _controls) { // Set style of each control to MaterialDesignFloatingHint, and set floating hint scale. if (elem.Value is TextBox textBox) { textBox.Style = (Style)FindResource("MaterialDesignOutlinedTextBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); textBox.GotFocus += TextBox_GotFocus; } else if (elem.Value is ComboBox comboBox) { comboBox.Style = (Style)FindResource("MaterialDesignOutlinedComboBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); } panel.Children.Add(elem.Value); } Grid.SetColumn(panel, 1); _currentPanel = panel; MainGrid.Children.Add(panel); }
public void RefreshWindowControls() { // Add controls to Dictionary for easier navigation. _controls.Clear(); var panel = new StackPanel { Name = "MainInfoPanel" }; var idBox = new TextBox { Name = "IdBox", Text = _pattern.BossLootId.ToString(), Margin = new Thickness(10), IsEnabled = false }; _controls.Add(idBox.Name, idBox); var nameBox = new ComboBox { Name = "NameBox", Margin = new Thickness(10) }; nameBox.SelectionChanged += NameBox_SelectionChanged; _controls.Add(nameBox.Name, nameBox); var rewardTypeBox = new ComboBox { Name = "RewardTypeBox", ItemsSource = Enum.GetValues(typeof(RewardType)), Margin = new Thickness(10) }; rewardTypeBox.SelectionChanged += RewardTypeBox_SelectionChanged; rewardTypeBox.SelectedValue = _pattern.BossLootType; var frequencyBox1 = new TextBox { Name = "FrequencyBox1", Text = _pattern.Frequencies[0].ToString(), Margin = new Thickness(10) }; var frequencyBox2 = new TextBox { Name = "FrequencyBox2", Text = _pattern.Frequencies[1].ToString(), Margin = new Thickness(10) }; var frequencyBox3 = new TextBox { Name = "FrequencyBox3", Text = _pattern.Frequencies[2].ToString(), Margin = new Thickness(10) }; var frequencyBox4 = new TextBox { Name = "FrequencyBox4", Text = _pattern.Frequencies[3].ToString(), Margin = new Thickness(10) }; var frequencyBox5 = new TextBox { Name = "FrequencyBox5", Text = _pattern.Frequencies[4].ToString(), Margin = new Thickness(10) }; var frequencyBox6 = new TextBox { Name = "FrequencyBox6", Text = _pattern.Frequencies[5].ToString(), Margin = new Thickness(10) }; // Set TextBox and ComboBox hints. HintAssist.SetHint(idBox, "ID"); HintAssist.SetHint(nameBox, "Name"); HintAssist.SetHint(rewardTypeBox, "RewardType"); HintAssist.SetHint(frequencyBox1, "Frequency1"); HintAssist.SetHint(frequencyBox2, "Frequency2"); HintAssist.SetHint(frequencyBox3, "Frequency3"); HintAssist.SetHint(frequencyBox4, "Frequency4"); HintAssist.SetHint(frequencyBox5, "Frequency5"); HintAssist.SetHint(frequencyBox6, "Frequency6"); _controls.Add(rewardTypeBox.Name, rewardTypeBox); _controls.Add(frequencyBox1.Name, frequencyBox1); _controls.Add(frequencyBox2.Name, frequencyBox2); _controls.Add(frequencyBox3.Name, frequencyBox3); _controls.Add(frequencyBox4.Name, frequencyBox4); _controls.Add(frequencyBox5.Name, frequencyBox5); _controls.Add(frequencyBox6.Name, frequencyBox6); foreach (var elem in _controls) { // Set style of each control to MaterialDesignFloatingHint, and set floating hint scale. if (elem.Value is TextBox textBox) { textBox.Style = (Style)FindResource("MaterialDesignOutlinedTextBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); textBox.GotFocus += TextBox_GotFocus; } else if (elem.Value is ComboBox comboBox) { comboBox.Style = (Style)FindResource("MaterialDesignOutlinedComboBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); } panel.Children.Add(elem.Value); } MainGrid.Children.Add(panel); }
public void RefreshStaticInfoPanel() { if (_currentPanel != null) { _currentPanel.Children.Clear(); MainGrid.Children.Remove(_currentPanel); } var panel = new StackPanel { Name = "StaticInfoPanel" }; var selectedArtifact = _dataContext; var idBox = new TextBox { Name = "IdBox", Text = selectedArtifact.Id.ToString(), Margin = new Thickness(10), IsEnabled = false }; var nameBox = new TextBox { Name = "NameBox", Text = selectedArtifact.Name, Margin = new Thickness(10) }; var rarityBox = new ComboBox { Name = "RarityBox", ItemsSource = Enum.GetValues(typeof(Rarity)), SelectedIndex = (int)selectedArtifact.Rarity, Margin = new Thickness(10) }; var artifactTypeBox = new ComboBox { Name = "ArtifactTypeBox", ItemsSource = Enum.GetValues(typeof(ArtifactType)), SelectedIndex = (int)selectedArtifact.ArtifactType, Margin = new Thickness(10) }; var descriptionBox = new TextBox { Name = "DescriptionBox", TextWrapping = TextWrapping.Wrap, VerticalAlignment = VerticalAlignment.Stretch, MinWidth = 280, AcceptsReturn = true, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, Height = 160, Text = selectedArtifact.Description, Margin = new Thickness(10) }; var loreBox = new TextBox { Name = "LoreBox", TextWrapping = TextWrapping.Wrap, VerticalAlignment = VerticalAlignment.Stretch, MinWidth = 280, AcceptsReturn = true, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, Height = 160, Text = selectedArtifact.Lore, Margin = new Thickness(10) }; var extraInfoBox = new TextBox { Name = "ExtraInfoBox", TextWrapping = TextWrapping.Wrap, VerticalAlignment = VerticalAlignment.Stretch, MinWidth = 280, AcceptsReturn = true, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, Height = 160, Text = selectedArtifact.ExtraInfo, Margin = new Thickness(10) }; // Set TextBox and ComboBox hints. HintAssist.SetHint(idBox, "ID"); HintAssist.SetHint(nameBox, "Name"); HintAssist.SetHint(rarityBox, "Rarity"); HintAssist.SetHint(artifactTypeBox, "Type"); HintAssist.SetHint(descriptionBox, "Description"); HintAssist.SetHint(loreBox, "Lore"); HintAssist.SetHint(extraInfoBox, "Extra info"); // Add controls to Dictionary for easier navigation. _controls.Clear(); _controls.Add(idBox.Name, idBox); _controls.Add(nameBox.Name, nameBox); _controls.Add(rarityBox.Name, rarityBox); _controls.Add(artifactTypeBox.Name, artifactTypeBox); _controls.Add(descriptionBox.Name, descriptionBox); _controls.Add(loreBox.Name, loreBox); _controls.Add(extraInfoBox.Name, extraInfoBox); foreach (var elem in _controls) { // Set style of each control to MaterialDesignFloatingHint, and set floating hint scale. if (elem.Value is TextBox textBox) { textBox.Style = (Style)FindResource("MaterialDesignOutlinedTextBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); textBox.GotFocus += TextBox_GotFocus; } else if (elem.Value is ComboBox comboBox) { comboBox.Style = (Style)FindResource("MaterialDesignOutlinedComboBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); } panel.Children.Add(elem.Value); } Grid.SetColumn(panel, 1); _currentPanel = panel; MainGrid.Children.Add(panel); }
public void RefreshWindowControls() { // Add controls to Dictionary for easier navigation. _controls.Clear(); var panel = new StackPanel { Name = "MainInfoPanel" }; var idBox = new TextBox { Name = "IdBox", Text = _pattern.QuestRewardId.ToString(), Margin = new Thickness(10), IsEnabled = false }; _controls.Add(idBox.Name, idBox); var nameBox = new ComboBox { Name = "NameBox", Margin = new Thickness(10) }; nameBox.SelectionChanged += NameBox_SelectionChanged; _controls.Add(nameBox.Name, nameBox); var rewardTypeBox = new ComboBox { Name = "RewardTypeBox", ItemsSource = Enum.GetValues(typeof(RewardType)), Margin = new Thickness(10) }; rewardTypeBox.SelectionChanged += RewardTypeBox_SelectionChanged; rewardTypeBox.SelectedValue = _pattern.QuestRewardType; var quantityBox = new TextBox { Name = "QuantityBox", Text = _pattern.Quantity.ToString(), Margin = new Thickness(10) }; // Set TextBox and ComboBox hints. HintAssist.SetHint(idBox, "ID"); HintAssist.SetHint(nameBox, "Name"); HintAssist.SetHint(rewardTypeBox, "RewardType"); HintAssist.SetHint(quantityBox, "Quantity"); _controls.Add(rewardTypeBox.Name, rewardTypeBox); _controls.Add(quantityBox.Name, quantityBox); foreach (var elem in _controls) { // Set style of each control to MaterialDesignFloatingHint, and set floating hint scale. if (elem.Value is TextBox textBox) { textBox.Style = (Style)FindResource("MaterialDesignOutlinedTextBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); textBox.GotFocus += TextBox_GotFocus; } else if (elem.Value is ComboBox comboBox) { comboBox.Style = (Style)FindResource("MaterialDesignOutlinedComboBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); } panel.Children.Add(elem.Value); } MainGrid.Children.Add(panel); }
public void RefreshStaticValuesPanel() { // Add controls to Dictionary for easier navigation. _controls.Clear(); if (_currentPanel != null) { _currentPanel.Children.Clear(); MainGrid.Children.Remove(_currentPanel); } var panel = new StackPanel { Name = "StaticInfoPanel" }; var selectedVendorPattern = _dataContext; var idBox = new TextBox { Name = "IdBox", Text = selectedVendorPattern.Id.ToString(), Margin = new Thickness(10), IsEnabled = false }; _controls.Add(idBox.Name, idBox); var vendorIdBox = new TextBox { Name = "VendorIdBox", Text = selectedVendorPattern.VendorItemId.ToString(), Margin = new Thickness(10), IsEnabled = false }; _controls.Add(vendorIdBox.Name, vendorIdBox); var nameBox = new ComboBox { Name = "NameBox", Margin = new Thickness(10), }; switch (_dataContext.VendorItemType) { case RewardType.Recipe: nameBox.ItemsSource = GameAssets.Recipes.Select(x => x.Name); nameBox.SelectedValue = GameAssets.Recipes.FirstOrDefault(x => x.Id == _dataContext.VendorItemId)?.Name; break; // todo: add other types here } nameBox.SelectionChanged += NameBox_SelectionChanged; _controls.Add(nameBox.Name, nameBox); var vendorTypeBox = new ComboBox { Name = "VendorTypeBox", ItemsSource = Enum.GetValues(typeof(RewardType)), Margin = new Thickness(10) }; vendorTypeBox.SelectedValue = selectedVendorPattern.VendorItemType; vendorTypeBox.SelectionChanged += RewardTypeBox_SelectionChanged; _controls.Add(vendorTypeBox.Name, vendorTypeBox); // Set TextBox and ComboBox hints. HintAssist.SetHint(idBox, "ID"); HintAssist.SetHint(vendorIdBox, "VendorItemId"); HintAssist.SetHint(nameBox, "Name"); HintAssist.SetHint(vendorTypeBox, "VendorTypeBox"); foreach (var elem in _controls) { // Set style of each control to MaterialDesignFloatingHint, and set floating hint scale. if (elem.Value is TextBox textBox) { textBox.Style = (Style)FindResource("MaterialDesignOutlinedTextBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); textBox.GotFocus += TextBox_GotFocus; } else if (elem.Value is ComboBox comboBox) { comboBox.Style = (Style)FindResource("MaterialDesignOutlinedComboBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); } panel.Children.Add(elem.Value); } Grid.SetColumn(panel, 1); _currentPanel = panel; MainGrid.Children.Add(panel); }
public void RefreshStaticValuesPanel() { if (_currentPanel != null) { _currentPanel.Children.Clear(); MainGrid.Children.Remove(_currentPanel); } var panel = new StackPanel { Name = "StaticInfoPanel" }; var selectedDungeonGroup = _dataContext; var idBox = new TextBox { Name = "IdBox", Text = selectedDungeonGroup.Id.ToString(), Margin = new Thickness(10), IsEnabled = false }; var nameBox = new TextBox { Name = "NameBox", Text = selectedDungeonGroup.Name, Margin = new Thickness(10) }; var colorBox = new TextBox { Name = "ColorBox", Text = selectedDungeonGroup.Color, Margin = new Thickness(10) }; var rarityBoxGeneral = new TextBox { Name = "RarityBoxGeneral", Text = selectedDungeonGroup.KeyRequirementRarities.Count(x => x == Rarity.General).ToString(), Margin = new Thickness(10) }; var rarityBoxFine = new TextBox { Name = "RarityBoxFine", Text = selectedDungeonGroup.KeyRequirementRarities.Count(x => x == Rarity.Fine).ToString(), Margin = new Thickness(10) }; var rarityBoxSuperior = new TextBox { Name = "RarityBoxSuperior", Text = selectedDungeonGroup.KeyRequirementRarities.Count(x => x == Rarity.Superior).ToString(), Margin = new Thickness(10) }; var rarityBoxExceptional = new TextBox { Name = "RarityBoxExceptional", Text = selectedDungeonGroup.KeyRequirementRarities.Count(x => x == Rarity.Exceptional).ToString(), Margin = new Thickness(10) }; var rarityBoxMasterwork = new TextBox { Name = "RarityBoxMasterwork", Text = selectedDungeonGroup.KeyRequirementRarities.Count(x => x == Rarity.Masterwork).ToString(), Margin = new Thickness(10) }; var rarityBoxMythic = new TextBox { Name = "RarityBoxMythic", Text = selectedDungeonGroup.KeyRequirementRarities.Count(x => x == Rarity.Mythic).ToString(), Margin = new Thickness(10) }; // Set TextBox and ComboBox hints. HintAssist.SetHint(idBox, "ID"); HintAssist.SetHint(nameBox, "Name"); HintAssist.SetHint(colorBox, "Color"); HintAssist.SetHint(rarityBoxGeneral, "General Keys Requirement"); HintAssist.SetHint(rarityBoxFine, "Fine Keys Requirement"); HintAssist.SetHint(rarityBoxSuperior, "Superior Keys Requirement"); HintAssist.SetHint(rarityBoxExceptional, "Exceptional Keys Requirement"); HintAssist.SetHint(rarityBoxMasterwork, "Masterwork Keys Requirement"); HintAssist.SetHint(rarityBoxMythic, "Mythic Keys Requirement"); // Add controls to Dictionary for easier navigation. _controls.Clear(); _controls.Add(idBox.Name, idBox); _controls.Add(nameBox.Name, nameBox); _controls.Add(colorBox.Name, colorBox); _controls.Add(rarityBoxGeneral.Name, rarityBoxGeneral); _controls.Add(rarityBoxFine.Name, rarityBoxFine); _controls.Add(rarityBoxSuperior.Name, rarityBoxSuperior); _controls.Add(rarityBoxExceptional.Name, rarityBoxExceptional); _controls.Add(rarityBoxMasterwork.Name, rarityBoxMasterwork); _controls.Add(rarityBoxMythic.Name, rarityBoxMythic); foreach (var elem in _controls) { // Set style of each control to MaterialDesignFloatingHint, and set floating hint scale. if (elem.Value is TextBox textBox) { textBox.Style = (Style)FindResource("MaterialDesignOutlinedTextBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); textBox.GotFocus += TextBox_GotFocus; } else if (elem.Value is ComboBox comboBox) { comboBox.Style = (Style)FindResource("MaterialDesignOutlinedComboBox"); HintAssist.SetFloatingScale(elem.Value, 1.0); } panel.Children.Add(elem.Value); } Grid.SetColumn(panel, 1); _currentPanel = panel; MainGrid.Children.Add(panel); }