public static void OnSelectedPerkQualityChange(DependencyObject obj, DependencyPropertyChangedEventArgs args) { PerkLvlPicker cp = obj as PerkLvlPicker; PerkQuality newPerk = (PerkQuality)args.NewValue; cp.SelectedPerkQuality = newPerk; //Debug.WriteLine(newPerk.Name); }
private static void OnSelectedBrushChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) { PerkLvlPicker cp = (PerkLvlPicker)obj; SolidColorBrush newBrush = (SolidColorBrush)args.NewValue; if (cp.SelectedColor != newBrush.Color) { cp.SelectedColor = newBrush.Color; } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ThisLevlPicker = ((FortHelper.PerkLvlPicker)(target)); return; case 2: this.Picker = ((System.Windows.Controls.ComboBox)(target)); return; } this._contentLoaded = true; }
private void cobLvLX_ColorChanged(object sender, RoutedPropertyChangedEventArgs <System.Windows.Media.Color> e) { PerkLvlPicker plpUsePicker = sender as PerkLvlPicker; Color mycolor = plpUsePicker.SelectedColor; //if(mycolor.Equals(Colors.LightGray)) //{ // ShowPerkName(plpUsePicker.Name, PerkQuality.Common); //} //else if(mycolor.Equals(Colors.DodgerBlue)) //{ // ShowPerkName(plpUsePicker.Name, PerkQuality.Rare); //} //else if(mycolor.Equals(Colors.DarkOrange)) //{ // ShowPerkName(plpUsePicker.Name, PerkQuality.Legendary); //} ShowPerkName(plpUsePicker.Name, plpUsePicker.SelectedPerkQuality); }
private static void OnSelectedColorChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) { PerkLvlPicker cp = obj as PerkLvlPicker; Debug.Assert(cp != null); Color newColor = (Color)args.NewValue; Color oldColor = (Color)args.OldValue; if (newColor == oldColor) { return; } // When the SelectedColor changes, set the selected value of the combo box if (cp.Picker.SelectedValue == null || (Color)cp.Picker.SelectedValue != newColor) { // Add the color if not found if (!cp.Picker.Items.Contains(newColor)) { cp.Picker.Items.Add(newColor); } } // Also update the brush cp.SelectedBrush = new SolidColorBrush(newColor); if (newColor == (Color)Colors.LightGray) { cp.SelectedPerkQuality = PerkQuality.Common; } else if (newColor == (Color)Colors.DodgerBlue) { cp.SelectedPerkQuality = PerkQuality.Rare; } else if (newColor == (Color)Colors.DarkOrange) { cp.SelectedPerkQuality = PerkQuality.Legendary; } cp.OnColorChanged(oldColor, newColor); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.gridBackground = ((System.Windows.Controls.Grid)(target)); return; case 2: this.borWeapon1 = ((System.Windows.Controls.Border)(target)); return; case 3: this.griBasic = ((System.Windows.Controls.Grid)(target)); return; case 4: this.griColorHeader = ((System.Windows.Controls.Grid)(target)); return; case 5: this.imgHeader = ((System.Windows.Controls.Image)(target)); return; case 6: this.griHeaderLine = ((System.Windows.Controls.Grid)(target)); return; case 7: this.dagWeapon1 = ((System.Windows.Controls.DataGrid)(target)); return; case 8: this.lblQuality = ((System.Windows.Controls.Label)(target)); return; case 9: this.cobWeapon = ((System.Windows.Controls.ComboBox)(target)); #line 99 "..\..\..\WinDPS.xaml" this.cobWeapon.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.cobWeapon_SelectionChanged); #line default #line hidden return; case 10: this.lblWeaponType = ((System.Windows.Controls.Label)(target)); return; case 11: this.cobPerk1 = ((System.Windows.Controls.ComboBox)(target)); #line 110 "..\..\..\WinDPS.xaml" this.cobPerk1.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.cobPerkX_SelectionChanged); #line default #line hidden return; case 12: this.cobPerk2 = ((System.Windows.Controls.ComboBox)(target)); #line 111 "..\..\..\WinDPS.xaml" this.cobPerk2.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.cobPerkX_SelectionChanged); #line default #line hidden return; case 13: this.cobPerk3 = ((System.Windows.Controls.ComboBox)(target)); #line 113 "..\..\..\WinDPS.xaml" this.cobPerk3.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.cobPerkX_SelectionChanged); #line default #line hidden return; case 14: this.cobPerk4 = ((System.Windows.Controls.ComboBox)(target)); #line 115 "..\..\..\WinDPS.xaml" this.cobPerk4.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.cobPerkX_SelectionChanged); #line default #line hidden return; case 15: this.cobPerk5 = ((System.Windows.Controls.ComboBox)(target)); #line 116 "..\..\..\WinDPS.xaml" this.cobPerk5.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.cobPerkX_SelectionChanged); #line default #line hidden return; case 16: this.cobLvL1 = ((FortHelper.PerkLvlPicker)(target)); return; case 17: this.cobLvL2 = ((FortHelper.PerkLvlPicker)(target)); return; case 18: this.cobLvL3 = ((FortHelper.PerkLvlPicker)(target)); return; case 19: this.cobLvL4 = ((FortHelper.PerkLvlPicker)(target)); return; case 20: this.cobLvL5 = ((FortHelper.PerkLvlPicker)(target)); return; case 21: this.dagDPS = ((System.Windows.Controls.DataGrid)(target)); return; case 22: this.chbShadow = ((System.Windows.Controls.CheckBox)(target)); #line 158 "..\..\..\WinDPS.xaml" this.chbShadow.Click += new System.Windows.RoutedEventHandler(this.chbShadow_Click); #line default #line hidden return; case 23: this.griTopLane = ((System.Windows.Controls.Grid)(target)); return; case 24: this.griBotLane = ((System.Windows.Controls.Grid)(target)); return; case 25: this.dgvInventory = ((System.Windows.Controls.DataGrid)(target)); #line 163 "..\..\..\WinDPS.xaml" this.dgvInventory.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.dgvInventory_SelectionChanged); #line default #line hidden return; case 26: #line 224 "..\..\..\WinDPS.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 27: this.txtPlayer = ((System.Windows.Controls.TextBox)(target)); #line 225 "..\..\..\WinDPS.xaml" this.txtPlayer.GotFocus += new System.Windows.RoutedEventHandler(this.ValueText_GotFocus); #line default #line hidden return; case 28: this.butLoad = ((System.Windows.Controls.Button)(target)); #line 226 "..\..\..\WinDPS.xaml" this.butLoad.Click += new System.Windows.RoutedEventHandler(this.butLoad_Click); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.gridBackground = ((System.Windows.Controls.Grid)(target)); return; case 2: this.borWeapon1 = ((System.Windows.Controls.Border)(target)); return; case 3: this.griBasic = ((System.Windows.Controls.Grid)(target)); return; case 4: this.griColorHeader = ((System.Windows.Controls.Grid)(target)); return; case 5: this.imgHeader = ((System.Windows.Controls.Image)(target)); return; case 6: this.griHeaderLine = ((System.Windows.Controls.Grid)(target)); return; case 7: this.dagWeapon1 = ((System.Windows.Controls.DataGrid)(target)); return; case 8: this.lblQuality = ((System.Windows.Controls.Label)(target)); return; case 9: this.cobWeapon = ((System.Windows.Controls.ComboBox)(target)); return; case 10: this.lblWeaponTyp = ((System.Windows.Controls.Label)(target)); return; case 11: this.cobPerk1 = ((System.Windows.Controls.ComboBox)(target)); return; case 12: this.cobPerk2 = ((System.Windows.Controls.ComboBox)(target)); return; case 13: this.cobPerk3 = ((System.Windows.Controls.ComboBox)(target)); return; case 14: this.cobPerk4 = ((System.Windows.Controls.ComboBox)(target)); return; case 15: this.cobPerk5 = ((System.Windows.Controls.ComboBox)(target)); return; case 16: this.cobLvL1 = ((FortHelper.PerkLvlPicker)(target)); return; case 17: this.cobLvL2 = ((FortHelper.PerkLvlPicker)(target)); return; case 18: this.cobLvL3 = ((FortHelper.PerkLvlPicker)(target)); return; case 19: this.cobLvL4 = ((FortHelper.PerkLvlPicker)(target)); return; case 20: this.cobLvL5 = ((FortHelper.PerkLvlPicker)(target)); return; case 21: this.griTopLane = ((System.Windows.Controls.Grid)(target)); return; case 22: this.griBotLane = ((System.Windows.Controls.Grid)(target)); return; case 23: #line 141 "..\..\WinDPS.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; } this._contentLoaded = true; }