public override int GetHashCode() { unchecked { var hashCode = IsChecked.GetHashCode(); hashCode = (hashCode * 397) ^ Id.GetHashCode(); hashCode = (hashCode * 397) ^ ProgressPerMinute.GetHashCode(); hashCode = (hashCode * 397) ^ (Image?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (Name?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ End.GetHashCode(); hashCode = (hashCode * 397) ^ Amount.GetHashCode(); hashCode = (hashCode * 397) ^ IsEditMode.GetHashCode(); return(hashCode); } }
private void tabHeader_MouseEnter(object sender, MouseEventArgs e) { if ((!IsChecked.GetValueOrDefault()) && Manager.Config.ShowPreviews) { var preview = new TabPreview() { Frame = ArmModule }; popup = new Popup() { Child = preview, PlacementTarget = this, AllowsTransparency = true }; popup.IsOpen = true; } }
private void OnIsCheckChanged() { if (IsChecked) { uncheckedAnimation.Stop(); checkedAnimation.Start(); } else { checkedAnimation.Stop(); uncheckedAnimation.Start(); } HtmlElement.SetAttribute("data-is-checked", IsChecked.ToString()); }
public QuickCheckbox(string name = "QuickCheckbox", Transform parent = null, UIOptionsTag prototype = null) { IEDebug.Log("Creating Checkbox : {0}", name); var chBox = (UIOptionsTag)Object.Instantiate(prototype ?? Prototype); chBox.transform.parent = parent; chBox.name = name; chBox.transform.localScale = new Vector3(1, 1, 1); chBox.transform.localPosition = new Vector3(0, 0, 0); GameObject = chBox.gameObject; GameObject.name = name; IEDebug.Log("IEMod created: " + chBox.name); IsChecked = BindingValue.Member(() => this.isChecked).ToBindable(); chBox.Checkbox.onStateChange += (a, b) => { IsChecked.NotifyChange(); }; }
void _DraggingThumb_DragStarted(object sender, DragStartedEventArgs e) { if (Mouse.LeftButton == MouseButtonState.Pressed) { if (!IsPressed) { SetIsPressed(true); } } if (_ThumbTranslate != null) { _ThumbTranslate.BeginAnimation(TranslateTransform.XProperty, null); double destination = IsChecked.GetValueOrDefault() ? ActualWidth - (_SwitchTrack.Margin.Left + _SwitchTrack.Margin.Right + _ThumbIndicator.ActualWidth + _ThumbIndicator.Margin.Left + _ThumbIndicator.Margin.Right) : 0; _ThumbTranslate.X = destination; _thumbAnimation = null; } _lastDragPosition = _ThumbTranslate.X; _isDragging = false; }
private void _DraggingThumb_DragStarted(object sender, VectorEventArgs e) { if (_DraggingThumb.IsPointerOver == false) { _lastDragPosition = null; _isDragging = false; return; } if (_ThumbTranslate != null) { //_ThumbTranslate.BeginAnimation(TranslateTransform.XProperty, null); double destination = IsChecked.GetValueOrDefault() ? Width - (_SwitchTrack.Margin.Left + _SwitchTrack.Margin.Right + _ThumbIndicator.Width + _ThumbIndicator.Margin.Left + _ThumbIndicator.Margin.Right) : 0; _ThumbTranslate.X = destination; _thumbAnimation = null; } _lastDragPosition = _ThumbTranslate.X; _isDragging = false; }
void updateContent() { if (IsChecked == null) { if (ContentMiddle != null) { base.Content = ContentMiddle; } base.IsEnabled = false; return; } base.IsEnabled = true; if (IsChecked.Equals(true)) { base.Content = ContentDown; } else { base.Content = ContentUp; } }
void _DraggingThumb_DragCompleted(object sender, DragCompletedEventArgs e) { SetIsPressed(false); _lastDragPosition = null; if (!_isDragging) { OnClick(); } else if (_ThumbTranslate != null && _SwitchTrack != null) { if (!IsChecked.GetValueOrDefault() && _ThumbTranslate.X + 6.5 >= _SwitchTrack.ActualWidth / 2) { OnClick(); } else if (IsChecked.GetValueOrDefault() && _ThumbTranslate.X + 6.5 <= _SwitchTrack.ActualWidth / 2) { OnClick(); } UpdateThumb(); } }
private void _DraggingThumb_DragCompleted(object sender, VectorEventArgs e) { _lastDragPosition = null; if (!_isDragging) { OnClick(); } else if (_ThumbTranslate != null && _SwitchTrack != null) { if (!IsChecked.GetValueOrDefault() && _ThumbTranslate.X + 6.5 >= _SwitchTrack.Width / 2) { OnClick(); } else if (IsChecked.GetValueOrDefault() && _ThumbTranslate.X + 6.5 <= _SwitchTrack.Width / 2) { OnClick(); } UpdateThumb(); } _isDragging = false; }
private void OnDragCompleted(object sender, DragCompletedEventArgs e) { _lastDragPosition = null; if (!_isDragging) { OnToggle(); } else if (_thumbTranslate != null && _switchTrack != null) { if (!IsChecked.GetValueOrDefault() && _thumbTranslate.X + 6.5 >= _switchTrack.ActualWidth / 2) { OnToggle(); } else if (IsChecked.GetValueOrDefault() && _thumbTranslate.X + 6.5 <= _switchTrack.ActualWidth / 2) { OnToggle(); } else { UpdateThumb(); } } }
//Other stuff here //... public override string ToString() { return(IsChecked.ToString()); }
/// <summary> /// Gets the non null value of IsChecked /// </summary> /// <returns>True if a Client has watched the ethical video, otherwise false</returns> public virtual bool HasWatchedEthicalVideo() { return(IsChecked.GetValueOrDefault()); }
void AppBarToggleButton_Click(object sender, RoutedEventArgs e) { VisualStateManager.GoToState(this, IsChecked.GetValueOrDefault() ? "Checked" : "Unchecked", false); }
public MainWindowViewModel() { Visibility = IsChecked .Select(b => b ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden) .ToReadOnlyReactivePropertySlim(); }
public override string ToString() { return(String.Format("{0} ({1})", Label, IsChecked.ToString())); }
private double GetThumbIndicatorDestination() { return(IsChecked.GetValueOrDefault() ? ActualWidth - (_switchTrack.Margin.Left + _switchTrack.Margin.Right + _thumbIndicator.Margin.Left + _thumbIndicator.Margin.Right + _thumbIndicator.ActualWidth) : 0); }
private void XPButton_Click(object sender, RoutedEventArgs e) { Debug.WriteLine("binding: " + IsChecked.ToString()); IsChecked = !IsChecked; }
public override int GetHashCode() { return(31 * IsChecked.GetHashCode() * Purpose.GetHashCode() * Type.GetHashCode()); }
/// <summary> /// Returns the visual used by <see cref="UpdateChildren"/>. /// </summary> /// <remarks> /// Depending on the the <see cref="ToggleButton.IsChecked">toggle state</see>, <see cref="CheckedVisual"/> /// or <see cref="UncheckedVisual"/> is returned. /// </remarks> /// <returns>The visual used by <see cref="UpdateChildren"/>.</returns> protected virtual Visual GetVisual() { return(IsChecked.GetValueOrDefault() ? CheckedVisual : UncheckedVisual); }
public void Load(UserInfoDatabase dbUserInfo) { if (UserName != null) { dbUserInfo.UserName = UserName; } if (Password != null) { dbUserInfo.Password = Password; } if (PasswordFormat != null) { dbUserInfo.PasswordFormat = PasswordFormat; } if (CreateDate != null) { dbUserInfo.CreateDate = (DateTime)CreateDate; } if (LastResetPasswordDate != null) { dbUserInfo.LastResetPasswordDate = (DateTime)LastResetPasswordDate; } if (LastActivityDate != null) { dbUserInfo.LastActivityDate = (DateTime)LastActivityDate; } if (CountOfLogin != null) { dbUserInfo.CountOfLogin = (int)CountOfLogin; } if (CountOfFailedLogin != null) { dbUserInfo.CountOfFailedLogin = (int)CountOfFailedLogin; } if (CountOfWriting != null) { dbUserInfo.CountOfWriting = (int)CountOfWriting; } if (IsChecked != null) { dbUserInfo.IsChecked = IsChecked.ToString(); } if (IsLockedOut != null) { dbUserInfo.IsLockedOut = IsLockedOut.ToString(); } if (DisplayName != null) { dbUserInfo.DisplayName = DisplayName; } if (Email != null) { dbUserInfo.Email = Email; } if (Mobile != null) { dbUserInfo.Mobile = Mobile; } if (AvatarUrl != null) { dbUserInfo.AvatarUrl = AvatarUrl; } if (Organization != null) { dbUserInfo.Organization = Organization; } if (Department != null) { dbUserInfo.Department = Department; } if (Position != null) { dbUserInfo.Position = Position; } if (Gender != null) { dbUserInfo.Gender = Gender; } if (Birthday != null) { dbUserInfo.Birthday = Birthday; } if (Education != null) { dbUserInfo.Education = Education; } if (Graduation != null) { dbUserInfo.Graduation = Graduation; } if (Address != null) { dbUserInfo.Address = Address; } if (WeiXin != null) { dbUserInfo.WeiXin = WeiXin; } if (Qq != null) { dbUserInfo.Qq = Qq; } if (WeiBo != null) { dbUserInfo.WeiBo = WeiBo; } if (Interests != null) { dbUserInfo.Interests = Interests; } if (Signature != null) { dbUserInfo.Signature = Signature; } }
public void Update() { State = IsChecked.Invoke() ? NSCellStateValue.On : NSCellStateValue.Off; }
/// <summary> /// Returns the current state of the checkbox value /// </summary> /// <returns></returns> public string Get() => IsChecked.ToString();